Best-match pattern for "sS" uses <appendItem> data

Description

From <https://unicode.org/reports/tr35/tr35-dates.html#Matching_Skeletons>:

3. A requested skeleton that includes both seconds and fractional seconds (e.g. “mmssSSS”) is allowed to match a dateFormatItem skeleton that includes seconds but not fractional seconds (e.g. “ms”). In this case the requested sequence of ‘S’ characters (or its length) should be retained separately and used when adjusting the pattern, as described below.

and

If the requested skeleton included both seconds and fractional seconds and the dateFormatItem skeleton included seconds but not fractional seconds, then the seconds field of the corresponding pattern should be adjusted by appending the locale’s decimal separator, followed by the sequence of ‘S’ characters from the requested skeleton.

ICU appears to implement this specification when more than one 'S' character is present, for example the best-match pattern for the skeleton "sSS" is "s.SS" or for "sSSS" is "s.SSS". But when only a single 'S' character is present, ICU instead uses the <appendItem> data, that means the skeleton "sS" returns the best-match pattern "S ('second': s)".

Is the use of "S ('second': s)" correct or should instead "s.S" be used?


(Setting the "ecmascript" and "ecma402" labels, because it affects <https://github.com/tc39/ecma402/pull/347>.)

Assignee

Mihai Nita

Reporter

André Bargull

Components

Labels

Reviewer

None

Priority

major

Time Needed

Days

Fix versions

Configure