Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There are two common formats for displaying time:
00:00
and counts up to23:59
For the purpose of this PR, the significant difference between these styles is what the smallest and largest possible numbers used for hours are. In 12-hour time, those numbers are "1" and "12," while in 24-hour time, they are "0" and "23." Javascript time formatting gives developers a boolean flag called
hours12
, which seems like the way to switch between these two systems, but this is unintuitively incorrect.The
hours12
flag might be better thought of as "how many hours should pass before I reset the count to the minimum number." In a typical 12-hour clock system, twelve hours pass before the number is reset to "1." In a typical 24-hour system, twenty-four hours pass before the number is reset to "0." So if you come from a location where you normally see time in a 12-hour range, and some developer changes thehours12
flag hoping to show you 24-hour time instead, you will actually end up in a time system with the smallest hour of "1:00" that doesn't reset back to that number until 24 hours have passed, meaning one hour a day will read as "24:XX." This is the source of the bug.This has been updated to require counting from "0:00" to "23:59" in all locales.