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.

Timepicker: selecting 12pm returns 24 hrs

See original GitHub issue

Using version 0.4.6.

There seems to be a bug with 12PM and 12AM-- selecting 12pm is returning “24 hours”. and 12AM is returning “12 hours”.

Using the TimePicker with all defaults, just setting the onDismiss and onConfirm:

<TimePickerModal
   visible={showTimePicker}
   onDismiss={onTimePickerDismissed}
   onConfirm={onTimePicked}     
/>

Picking 12 pm somehow adds an extra 12 hrs as if it is midnight.

Expected vs Actual (buggy) results below.

Expected:

Selected Value
11 AM 11 hours
12 PM 12 hours
1 PM 13 hours

What the Bug Shows:

Selected Value
11 AM 11 hours
12 PM 24 hours
1 PM 13 hours

Is the time picker not using standard 24 hr time?

If so, the hours should match as follows:

Selected Value
1 AM 1 hours
2 AM 2 hours
3 AM 3 hours
4 AM 4 hours
5 AM 5 hours
6 PM 6 hours
7 AM 7 hours
8 PM 8 hours
9 PM 9 hours
10 AM 10 hours
11 PM 11 hours
12 PM 12 hours
1 PM 13 hours
2 PM 14 hours
3 PM 15 hours
4 PM 16 hours
5 PM 17 hours
6 PM 18 hours
7 PM 19 hours
8 PM 20 hours
9 PM 21 hours
10 PM 22 hours
11 PM 23 hours
12 AM 24 hours

The logic for 12AM/PM has been swapped with this time picker.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:2
  • Comments:12 (8 by maintainers)

github_iconTop GitHub Comments

5reactions
J3j3mcommented, Oct 16, 2021

Pull Request submitted : Link To PR

3reactions
J3j3mcommented, Oct 11, 2021

I found the problem, I’ll try to make PR by the end of the week.

Read more comments on GitHub >

github_iconTop Results From Across the Web

DateTimePicker time picker in 24 hour but displaying in 12hr?
Meridian pertains to AM/PM, by setting it to false you're indicating you don't want AM/PM, therefore you want 24-hour clock implicitly. $('#timepicker1').
Read more >
jQuery Timepicker Options
int The 24-hour part of the first item in the combobox when the input field is emptye. If input field is not empty...
Read more >
ngx-timepicker-field 24 hour format Invalid DateTime for 00:00 ...
While having a 24h format and starting with 12:30 o`clock, I click the arrow buttons to 00:30. From 01 -> 00 the error...
Read more >
Options - getdatepicker.com
Returns the component's model current date, a moment object or null if not set. ... the TimePicker sub component will display the hours...
Read more >
Form Timepicker | Components - BootstrapVue
... up to '23:59:59' (24-hour clock using the 'h23' hour cycle syntax). If no time is selected, then <b-form-timepicker> returns an empty string...
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