question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

AM/PM picker not displayed for some locales

See original GitHub issue

The date time picker use locale to determine if the hour format is 12 or 24, but this is not always the best way. for example, if the locale is “zh-Hans-CN” it will use 12 hours format, but in China the 24 hours format is the primary time format. further more, even use 12 hours format, the time result is also not correct for “zh-Hans-CN” The Intl.DateTimeFormat with “zh-Hans-CN” locale will format the time “15:00:00” to “下午3:00:00” where (下午 is pm), but datetime picker finally dispaly the time as 3:00:00. Is it possible we add an option such as “h24”, and if it has value, just pass it to the formatDate function, and in this function, check if the parameter “h24” has value or not, and set “hour12” to true or false when call new Intl.DateTimeFormat

Thanks

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
cbfrankcommented, Nov 22, 2018

@wojtekmaj 2.1.1 works, thanks!

0reactions
wojtekmajcommented, Nov 21, 2018

My bad, try 2.1.1.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Not able to select AM/PM dynamically in TimePickerDialog
So you can convert it to 12 Hour AM-PM with below way. public void onTimeSet(TimePicker view, int selectedHour, int selectedMinute) { String AM_PM...
Read more >
DateTime picker displays incorrect format for our region
The date picker always returns and displays as mm/dd/yyyy I have set DateTimeZone to local and I've set the regional setting in SharePoint...
Read more >
Date and Time pickers - Localization - MUI X
Date and Time pickers allow to support users from different locales, with formatting, RTL, and localized ... This can be overridden by using...
Read more >
Date Time Picker AM/PM values in Hungarian local ... - Atlassian
The date time picker's interface and return value in the Hungarian local should be DE/DU instead of AM/PM respectively. An error occurs when...
Read more >
Date and Time Picker - JSON Forms
The text input is configured to only show the full hours while both hours and minutes are saved into the data. The picker...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found