-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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 parsing AM/PM hours #9334
Fix parsing AM/PM hours #9334
Conversation
Not quite there yet.
I think we need to turn |
So we're missing even more specs... =) |
Might also want to add some to verify |
Co-authored-by: Jonne Haß <me@jhass.eu>
I found another issue and fixed it in 9a90d33: On the 24-hour clock, 24:00 is a valid time indicating midnight and equivalent to 00:00 of the next day (see ISO 8601 §5.3). The validation in |
Should this be If yes, make sure |
Hm, I guess either could be right? Ruby parses Maybe Ruby's implementation didn't think about this case. And it's really rare. |
Well, for 0-11 it parses as AM, so why not parse the full range as AM? |
Okay, I'll use that. That means |
Also added a spec for when 24-hour clock hour is used with am/pm (which is ignored). |
So right now this rejects I don't care too much which way we go, looking at https://en.wikipedia.org/wiki/12-hour_clock#Confusion_at_noon_and_midnight |
Oh yeah |
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.
This seems to implement the most common interpretation according to https://en.wikipedia.org/wiki/12-hour_clock#Confusion_at_noon_and_midnight now
Fixes #9333