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
I assume that options like timeZone, calendar, and fractionalSecondDigitswill be supported because they affect the non-localized numeric values of the output. If this assumption is wrong, please explain why. Thanks!
That sounds reasonable. I'm not very familiar with other calendars than Gregorian; do others also have standardised ways of displaying dates?
After thinking about it, I'm not sure that supporting the calendar option would be a good idea or not.
Although each CLDR calendar has a year, month, and day for every ISO date, the ISO 8601 format (at least in Temporal) implies the ISO calendar too. So in Temporal, the output of a chinese date's toString isn't YYYY-MM-DD using chinese year,month/day vaues. Instead it's YYYY-MM-DD[u-ca=chinese]. This might create ambiguity about what a non-ISO-calendar's YYYY-MM-DD output represents.
That said, existing code might be using formatToParts to extract non-ISO-calendar year, month, and day. This might argue for accepting a calendar option.
So it's a bit of a quandry: using calendar in format is problematic for Temporal alignment reasons, while not using it in formatToParts is problematic for backwards-compatibility reasons. (Where "backwards compatibility" means that users can switch their existing code that uses a locale like en-US with formatToParts without breaking that code.)
The text was updated successfully, but these errors were encountered:
From #2 (comment):
After thinking about it, I'm not sure that supporting the calendar option would be a good idea or not.
Although each CLDR calendar has a year, month, and day for every ISO date, the ISO 8601 format (at least in Temporal) implies the ISO calendar too. So in Temporal, the output of a chinese date's
toString
isn't YYYY-MM-DD using chinese year,month/day vaues. Instead it'sYYYY-MM-DD[u-ca=chinese]
. This might create ambiguity about what a non-ISO-calendar's YYYY-MM-DD output represents.That said, existing code might be using
formatToParts
to extract non-ISO-calendar year, month, and day. This might argue for accepting acalendar
option.So it's a bit of a quandry: using
calendar
informat
is problematic for Temporal alignment reasons, while not using it informatToParts
is problematic for backwards-compatibility reasons. (Where "backwards compatibility" means that users can switch their existing code that uses a locale likeen-US
withformatToParts
without breaking that code.)The text was updated successfully, but these errors were encountered: