You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hmm, this shouldn't be happening according to my reading of the spec — do you know what's the difference between the two formats in the above code example? Is there something extra that should be in allowedOptions but isn't?
AdjustDateTimeStyleFormat calls either BasicFormatMatcher or BestFitFormatMatcher, which compute the format using the data in %Intl.DateTimeFormat%.[[LocaleData]].[[<locale>]].[[formats]]. Whereas DateTimeStyleFormat uses the format data from %Intl.DateTimeFormat%.[[LocaleData]].[[<locale>]].[[styles]]. This distinction is based on how CLDR structures the data (<dateFormats> and <timeFormats> for the [[styles]] record and <availableFormats> for the [[formats]] record.)
Because there are two different data sources ([[styles]] and [[formats]]), calling AdjustDateTimeStyleFormat with a format record from DateTimeStyleFormat can lead to different outputs, as shown in the example.
There's a <datetimeSkeleton> element in CLDR to map styles to available formats, so we could change ECMA-402 to define [[styles]] in terms of the formats in [[formats]]. That way it's guaranteed that every format from DateTimeStyleFormat can also be returned from {Basic,BestFit}FormatMatcher, which ensures we get consistent formatting. Unfortunately ICU4C doesn't yet support returning <datetimeSkeleton> and CLDR data also needs some fixing first, see https://unicode-org.atlassian.net/browse/CLDR-14993.
AdjustDateTimeStyleFormat determines a new format even when no conflicting options are present. This leads to the following results:
The polyfill already appears to use the original format, because it returns:
The text was updated successfully, but these errors were encountered: