-
Notifications
You must be signed in to change notification settings - Fork 176
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
[Date]TimeFormatter constructors don't take hour12 override #3881
Comments
Maybe |
|
I don't think we have |
Letting the locale affect AFAICT, by the time the |
macOS Ventura and Gnome expose a boolean system pref for this topic, so |
Looking at https://github.com/unicode-org/cldr-json/blob/80a94b0f6c3a34d6e2dc0dca8639a54babc87f94/cldr-json/cldr-core/supplemental/timeData.json#L4 , I observe:
Given that the preferred cycle for each locale is either |
The current spec is incorrect. There's a PR to fix this → tc39/ecma402#758. |
Thanks. Given that change and the non-existence of |
|
Oops. I missed that. So:
Thanks. |
Yes. For example
And
In an input skeleton, Spec:
The They're possibly relevant for the stage-3 "Intl Locale Info" proposal. There's a HourCyclesOfLocale operation, which is spec'ed to return the hour-cycle formats which are in "common use for date and time formatting". So this operation could return the ICU4C doesn't have a public API to retrieve the |
Thanks. So ICU4X is currently missing a way to handle Just so that I understand the feasibility of hard-coded special cases if this issue isn't addressed in ICU4X itself: It would be possible for ECMA-402 implementation glue code to get correct results (with the scope of what's known about what is in CLDR) by expanding the boolean That is:
The rendered spec that you linked to has
I don't see any non-test callers for that method. What am I missing? |
It needs to be hard-coded on the language, not the region, because the date-time patterns are in https://github.com/unicode-org/cldr/blob/main/common/main/ja.xml.
Only the parts relevant for the "Unified Intl API" work (bug 1686965) have been committed in bug 1693576. The rest will be put up for review when the open issues in the proposal have been resolved. |
There is some interesting code to handle some of this resolution logic in components/datetime/src/pattern/hour_cycle.rs I also observe that we already have the preferred hour cycle (h11h12 or h23h24) in ICU4X data: https://github.com/unicode-org/icu4x/blob/main/provider/datagen/tests/data/json/datetime/timelengths%401/en.json\ So I think everything is here to support |
Just to make this clearer for those playing along here. Japan is the only country that allows support for the use of
The options are Currently ECMA spec incorrectly assumes a coupling of
The ECMA standard definitely needs to change as the current implementation is a bug. The universal (as far as I've been able to determine) rejection of |
ECMA-402 has
hour12
andhourCycle
overrides for the locale's hour cycle. AFAICT, ICU4X[Date]TimeFormatter
constructors don't have API surface for this override. For ECMA-402 compat, ICU4X should have API surface for this.The text was updated successfully, but these errors were encountered: