-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
fix(timepicker): respect meridian setting when entring hours #1636
fix(timepicker): respect meridian setting when entring hours #1636
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@ultimatedion not sure I understand your comment, for me things work as expected. To start with let's see some things straight. According to https://en.wikipedia.org/wiki/12-hour_clock we should interpret:
Given the above we've got 2 cases when users enters
For me this is proper behaviour. Could you please clarify what exactly what you mean by
The idea of limiting possible values to enter to 1-12 is another topic - feel free to open an issue for this. I'm going to hold of merging of this PR for a bit to give you a chance to comment (but won't delay it for long). But please, be more precise as I'm really not clear at this point what is troubling you in the code of this PR. |
@pkozlowski-opensource You are right. My analysis of your fix was wrong. I had in mind that the I agree with you for the first case.
According to this line: newVal(12) + 12 = 24 which will be converted back to 0 This might not be an issue if the I cannot test it at the moment. |
Hi Actually I was going to say the same thing: entering 12 with PM on screen will result in 0 AM I think. |
@ultimatedion @ExFlo you are right, there is an issue for this case:
I will add test for the noon / midnight cases to explicitly say what is the expected behaviour in those cases. Thnx for the heads up and review, much appreciated! |
@ultimatedion @ExFlo I've added explicit tests for the |
Fixes #1631