New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Timepicker: selecting 12pm returns 24 hrs #105
Comments
Did you find any solution / workaround for this ? |
12 PM is 24 hours? |
12 AM is 12:00
Or am I missing something? |
Yeah, that's the bug. As the library stands right now, if a user selects 12pm in the picker, the value returned is 24. |
I don’t understand it’s correct behaviour how would you now if it’s not 12
am? If it both returns 12
Op do 30 sep. 2021 om 17:04 schreef aaronfg ***@***.***>
12 PM is 24 hours?
Yeah, that's the bug.
As the library stands right now, if a user selects 12pm in the picker, the
value returned is 24.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#105 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABRRARKPXGSF6ZMHPCY4H5TUER36XANCNFSM5EAQSXVQ>
.
--
*Richard Lindhout* | *Eigenaar*
*Bel mij +31 6 43 42 45 67* <+31643424567>
[image: logo webridge]
Beatrixlaan 2, 4694EG Scherpenisse
*KVK 56845367*
*BTW NL002365659B60*
*IBAN NL93 BUNQ 2038 9661 33*
*WEB webRidge.nl <https://webridge.nl/>*
|
I don't understand your reply. Selecting 12:00pm in the picker should return this: {
hours: 12,
minutes: 0,
} But it's not. it's returning: {
hours: 24,
minutes: 0,
} This is just categorically wrong. 24 hours is 12 AM. Your picker is saying that 12pm is somehow 12AM. I don't know how else to explain this. I put the tables above to show the bug. Just look at the values. You're going from 11 to 24 to 13 in the hours as you choose 11AM, 12PM, and 1PM. As it is now, your picker is using 24 hour time correctly for all hours except for 12pm and 12AM. Those values are reversed. That is the bug. UPDATE with Expo example: https://snack.expo.dev/OjJhGVl_T Select 12 PM , hit ok and look at the log. it will show 12pm is not the 24th hour of the day. |
Ok you're right I didn't grow up with AM/PM that's why I was so confused. This is a serious bug.. |
I'll try to make some time in the evening next week to fix this bug |
No worries! Thanks for looking into it. Much appreciated! |
I found the problem, I'll try to make PR by the end of the week. |
Pull Request submitted : Link To PR |
fix(timepicker): selecting 12pm returns 24 hrs
Thanks a lot @J3j3m! |
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
andonConfirm
:Picking 12 pm somehow adds an extra 12 hrs as if it is midnight.
Expected vs Actual (buggy) results below.
Expected:
What the Bug Shows:
Is the time picker not using standard 24 hr time?
If so, the hours should match as follows:
The logic for 12AM/PM has been swapped with this time picker.
The text was updated successfully, but these errors were encountered: