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
js>newIntl.DateTimeFormat("en-u-ca-iso8601",{dateStyle: "full",timeStyle: "full"}).format(Temporal.PlainDateTime.from("2025-02-10T10:15:30"))"2025 February 10, Monday at 10:15:30"js>newIntl.DateTimeFormat("en-u-ca-iso8601",{dateStyle: "long",timeStyle: "long"}).format(Temporal.PlainDateTime.from("2025-02-10T10:15:30"))"2025 February 10 at 10:15:30"js>newIntl.DateTimeFormat("en-u-ca-iso8601",{dateStyle: "medium",timeStyle: "medium"}).format(Temporal.PlainDateTime.from("2025-02-10T10:15:30"))"2025 Feb 10, 10:15:30"js>newIntl.DateTimeFormat("en-u-ca-iso8601",{dateStyle: "short",timeStyle: "short"}).format(Temporal.PlainDateTime.from("2025-02-10T10:15:30"))"2025-02-10, 10:15"
Interestingly the <timeFormat> elements default to a 24-hour clock, which can lead to kind of inconsistent hour-cycle displays. (But that's something which can be easily fixed in JS engines.)
The motivation for this change was to provide a better locale to display ISO-8601 style date-time formats without having to use unrelated locales like "en-DK" or "en-SE".
Given this motivation, I find it quite surprising for the release notes to include this about -u-ca-iso8601 formatting:
[...] In this first version, the separators are not localized, and will use “-“ within numeric dates, “:” within times, and “ “ or “, “ between major elements. Full localization will await the next submission phase for CLDR.
CLDR 46 added new date-time patterns for the ISO-8601 calendar type to the root locale. See https://cldr.unicode.org/downloads/cldr-46#locale-changes. The motivation for this change was to provide a better locale to display ISO-8601 style date-time formats without having to use unrelated locales like "en-DK" or "en-SE". CLDR ticket: https://unicode-org.atlassian.net/browse/CLDR-16446
Examples:
When using
dateStyle
andtimeStyle
:(Note: The "at" separator shouldn't actually be present → https://unicode-org.atlassian.net/browse/CLDR-17968.)
Interestingly the
<timeFormat>
elements default to a 24-hour clock, which can lead to kind of inconsistent hour-cycle displays. (But that's something which can be easily fixed in JS engines.)Text components are localised:
The text was updated successfully, but these errors were encountered: