0

How to change time input to 24-hour format? I used it for testing in Jenkins pipeline, the test misses the am/pm input. My intended user doesn't need am/pm input.

I already change the locale to my country id and restart the Linux server

LANG=id_ID.UTF-8
LANGUAGE=
LC_CTYPE="id_ID.UTF-8"
LC_NUMERIC="id_ID.UTF-8"
LC_TIME="id_ID.UTF-8"
LC_COLLATE="id_ID.UTF-8"
LC_MONETARY="id_ID.UTF-8"
LC_MESSAGES="id_ID.UTF-8"
LC_PAPER="id_ID.UTF-8"
LC_NAME="id_ID.UTF-8"
LC_ADDRESS="id_ID.UTF-8"
LC_TELEPHONE="id_ID.UTF-8"
LC_MEASUREMENT="id_ID.UTF-8"
LC_IDENTIFICATION="id_ID.UTF-8"
LC_ALL=

that doesn't work,

also tried adding lang args to launch --window-size=${width},${height} --lang=id doesn't work too.

It occurs when puppeteer render input with the type time

<input type="time" name="time" value="" class="form-control">

In my local computer, it renders

in local

in the Linux Jenkins server, I the screenshot renders

enter image description here

otong
  • 1,387
  • 2
  • 17
  • 28
  • Can you more clear your question? Which and where time input to puppeteer? Or show some codes about it – Chuong Tran Mar 04 '19 at 04:54
  • @ChuongTran Okay, I updated the question, it happens when there's `time` input. It render with am/pm field I suppose. – otong Mar 04 '19 at 05:07

1 Answers1

1

I see in document type=time , 12 or 24-hour format depending on operating system locale.

Check locale:

$ locale

LANG=en_US.UTF-8
LANGUAGE=en_US
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_PAPER="en_US.UTF-8"
LC_NAME="en_US.UTF-8"
LC_ADDRESS="en_US.UTF-8"
LC_TELEPHONE="en_US.UTF-8"
LC_MEASUREMENT="en_US.UTF-8"
LC_IDENTIFICATION="en_US.UTF-8"
LC_ALL=

Change locale:

$ sudo update-locale LANG=LANG=en_IN.UTF-8 LANGUAGE

OR

$ sudo localectl set-locale LANG=en_IN.UTF-8

Do you try to change locale your server same with your local? Hope it work :)

Edited: If you don't want time format depending on the locale of the system, you can follow this post (using timepicker.js)

Chuong Tran
  • 3,131
  • 17
  • 25