Skip to content

Editorial: Replace AvailableCanonicalCalendars with AvailableCalendars#889

Merged
gibson042 merged 1 commit intotc39:mainfrom
ptomato:726-canonical-calendars
Jun 4, 2024
Merged

Editorial: Replace AvailableCanonicalCalendars with AvailableCalendars#889
gibson042 merged 1 commit intotc39:mainfrom
ptomato:726-canonical-calendars

Conversation

@ptomato
Copy link
Contributor

@ptomato ptomato commented May 8, 2024

AvailableCalendars should return all possible aliases, so that other places in the spec (e.g. in the future, validating a string calendar ID in Temporal) can use them to determine whether a given input value is valid. This input value can subsequently be canonicalized by another abstract operation, CanonicalizeUValue, which we can use in several other places.

In Intl.supportedValuesOf(), on the other hand, we should not return all possible aliases, so we filter them out using CanonicalizeUValue before returning the list of AvailableCalendars codes as an array to the caller.

See tc39/proposal-intl-enumeration#49. This is the part of that PR that I consider relevant for the future integration of Temporal. The time zone parts were already done as part of #876. If desired, I could implement the rest of that PR, adding CanonicalizeCollation, CanonicalizeCurrency, CanonicalizeNumberingSystem, and CanonicalizeUnit as well.

Closes: #726

@ben-allen ben-allen requested review from gibson042 and ryzokuken May 9, 2024 14:59
@ben-allen ben-allen added the editorial Involves an editorial fix label May 16, 2024
@ptomato ptomato force-pushed the 726-canonical-calendars branch from e694fac to cefb31c Compare June 4, 2024 16:12
@ptomato ptomato requested a review from gibson042 June 4, 2024 16:12
Copy link
Member

@gibson042 gibson042 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great!

@gibson042 gibson042 changed the title Editorial: Canonicalization operation for calendar IDs Editorial: Replace AvailableCanonicalCalendars with AvailableCalendars Jun 4, 2024
AvailableCalendars should return all possible aliases, so that other
places in the spec (e.g. in the future, validating a string calendar ID in
Temporal) can use them to determine whether a given input value is valid.
This input value can subsequently be canonicalized by another abstract
operation, CanonicalizeUValue, which we can use in several other places.

In Intl.supportedValuesOf(), on the other hand, we should not return all
possible aliases, so we filter them out using CanonicalizeUValue before
returning the list of AvailableCalendars codes as an array to the caller.

See tc39/proposal-intl-enumeration#49. This is the
part of that PR that I consider relevant for the future integration of
Temporal. The time zone parts were already done as part of tc39#876. If
desired, I could implement the rest of that PR, additionally supporting
collation, currency, numbering system, and unit canonicalization.

Closes: tc39#726
@gibson042 gibson042 force-pushed the 726-canonical-calendars branch from cefb31c to f14cbed Compare June 4, 2024 17:02
@gibson042 gibson042 merged commit c35b0ff into tc39:main Jun 4, 2024
@ptomato ptomato deleted the 726-canonical-calendars branch June 4, 2024 21:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

editorial Involves an editorial fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Specify canonicalization algorithms for Intl enumeration

3 participants