Make datetime styles (lengths) map to skeletons instead of patterns
Description
blocks
relates to
Activity

Frank Yung-Fong Tang October 26, 2021 at 9:44 PM
Peter could you take a look at
This might be an unintentional changes to ICU’s hi-u-ca-indian date formatting .
Peter Edberg August 18, 2021 at 5:32 PM
Forked off for the remaining issues. So this can be closed for the work that is in CLDR 40.
Peter Edberg May 26, 2021 at 3:59 PM
Most of this is done in PR-1275. However there are some issues discussed in that PR to be resolved. For one, it is not currently possible to actually generate all patterns from skeletons, as in the following example for zh/gregorian:
Peter Edberg May 19, 2021 at 7:41 AM
Hi Mark,
For the first part of item 2 below, do you think it would be better/easier to
enhance CLDRModify -k to do that (I would have to add a special function in CLDRModify that calls DateTimePatternGenerator.getSkeleton to convert the patterns to the skeleton to add), or
write a separate stand-alone tool to generate the skeleton entries?
In either case, the test that pattern generated from the skeleton matches the original pattern I was going to do as a separate test that could be invoked from ConsoleCheckCLDR or the Survey Tool. Note that DateTimePatternGenerator already has getInstanceNoStdPat() that will skip adding skeletons created from the standard patterns (which is the behavior we need for this test).
Then I would run that over the first-pass generated skeleton data to make adjustments to availableFormats (and possibly the generated skeletons) to fix the errors.
Peter E
The XML for datetime styles/lengths currently looks something like this:
Under the dateFormatLength element, I would like to propose changing `<pattern>` to `<skeleton>`. In this case, we would end up with something like,
The skeleton can then be mapped to the pattern using `<availableFormats>`, in this case with an exact match.
Why? In ECMAScript, we have an active proposal driven by Mozilla to make dateStyle/timeStyle (short/medium/long/full) a first-class citizen in JavaScript. However, we have encountered several issues during the implementation, such as ICU-20710, as well as a desire to be able to use dateStyle/timeStyle but omit certain fields. This can be done elegantly using the skeleton, but would require much more work to do it using the pattern.