Description
Background: The H24 hour cycle is one where the first hour of the day is labeled 24, the second hour is labeled 01, and the last hour is labeled 23. The H23 hour cycle is one where the first hour of the day is labeled 00, the second hour is labeled 01, and the last hour is labeled 23. All locales that use 24-hour clocks currently use the H23 hour cycle; we are not aware of any that use the H24 hour cycle.
In https://unicode-org.atlassian.net/browse/CLDR-18303, the CLDR Design WG is recommending to deprecate the H24 hour cycle.
ICU4X currently decided to not support the H24 hour cycle.
The H24 hour cycle is a footgun and is likely to not be noticed by testing since it differs from H23 in only one hour of the day (the first hour).
What should browsers do?
For example, in all browsers, you can currently write the following code:
// Formats with the 24-hour clock where the first hour is hour 0
new Date(0, 0, 0, 0, 0, 0).toLocaleTimeString("en-u-hc-h23")
'00:00:00'
// Formats with the 24-hour clock where the first hour is hour 24
new Date(0, 0, 0, 0, 0, 0).toLocaleTimeString("en-u-hc-h24")
'24:00:00'
// Formats with the locale's default hour cycle, since H25 is not a valid hour cycle
new Date(0, 0, 0, 0, 0, 0).toLocaleTimeString("en-u-hc-h25")
'12:00:00 AM'
There are a few approaches we could take:
- H24 falls back to locale default behavior, similar to how H25 currently behaves. This means that users who currently use H24 will start seeing a 12-hour clock in some locales.
- H24 falls back to H23 behavior.
- We keep supporting H24. This means ICU4X needs to start supporting it, even though it is legacy.
- We throw an exception. However, H25 continues to behave as it currently behaves.
I'd like us to focus on which options are acceptable to us.
If we don't want to break the web, I don't see a way for us to land on (1) or (4). Do we consider (2) to be breaking the web or do we consider it to be a bug fix?
Metadata
Metadata
Assignees
Labels
Type
Projects
Status