Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Editorial: Replace AvailableCanonicalCalendars with AvailableCalendars #889

Merged
merged 1 commit into from
Jun 4, 2024

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 added the editorial Involves an editorial fix label May 16, 2024
spec/intl.html Outdated Show resolved Hide resolved
spec/locales-currencies-tz.html Outdated Show resolved Hide resolved
spec/locales-currencies-tz.html Outdated Show resolved Hide resolved
Copy link
Contributor

@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 merged commit c35b0ff into tc39:main Jun 4, 2024
2 checks passed
@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