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: align time zone identifier text and AOs with ECMA-262 #876

Merged
merged 1 commit into from
Apr 25, 2024

Conversation

justingrant
Copy link
Contributor

@justingrant justingrant commented Mar 31, 2024

This PR updates ECMA-402 spec text to align with current ECMA-262 terminology and AOs for time zone identifiers. Changes include:

  • Replaces DefaultTimeZone, CanonicalizeTimeZoneName, and IsValidTimeZoneName with calls to current ECMA-262 abstract operations.
  • Refactors AvailableCanonicalTimeZones to call new ECMA-262 AOs, and renames it to AvailablePrimaryTimeZoneIdentifiers.
  • Adds a GetAvailableNamedTimeZoneIdentifier AO Temporal will eventually merge into ECMA-262, but it's not there yet so we need a copy here.
  • Replaces #sec-time-zone-names with a "Use of the IANA Time Zone Database" section that extends ECMA-262's #sec-time-zone-identifiers section.
  • Adds a few paragraphs of editorial recommendations (borrowed from Temporal) about managing updates and builds of TZDB.

justingrant added a commit to justingrant/ecma402 that referenced this pull request Mar 31, 2024
This PR resolves tc39#825 by adding spec text that defines how ECMA-402
implementations should decide which IANA time zone IDs should be
primary vs. non-primary.

This PR implements "Option C" in tc39#825 by deterministically defining
ECMAScript's exceptions from the IANA Time Zone Database's defaults,
and then pointing implementers at ICU as a convenient implementation
of those exceptions.

This PR also accommodates to web reality by aligning the 402 spec text
with the existing behavior of ICU.

This PR is stacked on top of tc39#876.
justingrant added a commit to justingrant/ecma402 that referenced this pull request Mar 31, 2024
This PR resolves tc39#825 by adding spec text that defines how ECMA-402
implementations should decide which IANA time zone IDs should be
primary vs. non-primary.

This PR implements "Option C" in tc39#825 by deterministically defining
ECMAScript's exceptions from the IANA Time Zone Database's defaults,
and then pointing implementers at ICU as a convenient implementation
of those exceptions.

This PR also accommodates to web reality by aligning the 402 spec text
with the existing behavior of ICU.

This PR is stacked on top of tc39#876.
justingrant added a commit to justingrant/ecma402 that referenced this pull request Mar 31, 2024
This PR resolves tc39#825 by adding spec text that defines how ECMA-402
implementations should decide which IANA time zone IDs should be
primary vs. non-primary.

This PR implements "Option C" in tc39#825 by deterministically defining
ECMAScript's exceptions from the IANA Time Zone Database's defaults,
and then pointing implementers at ICU as a convenient implementation
of those exceptions.

This PR also accommodates to web reality by aligning the 402 spec text
with the existing behavior of ICU.

This PR is stacked on top of tc39#876.
@justingrant justingrant added editorial Involves an editorial fix needs review needs tests and removed needs tests labels Mar 31, 2024
Copy link
Contributor

@ptomato ptomato left a comment

Choose a reason for hiding this comment

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

Works for me!

spec/datetimeformat.html Outdated Show resolved Hide resolved
spec/datetimeformat.html Show resolved Hide resolved
spec/locales-currencies-tz.html Outdated Show resolved Hide resolved
spec/locales-currencies-tz.html Outdated Show resolved Hide resolved
spec/locales-currencies-tz.html Show resolved Hide resolved
spec/locales-currencies-tz.html Outdated Show resolved Hide resolved
justingrant added a commit to justingrant/ecma402 that referenced this pull request Apr 3, 2024
This PR resolves tc39#825 by adding spec text that defines how ECMA-402
implementations should decide which IANA time zone IDs should be
primary vs. non-primary.

This PR implements "Option C" in tc39#825 by deterministically defining
ECMAScript's exceptions from the IANA Time Zone Database's defaults,
and then pointing implementers at ICU as a convenient implementation
of those exceptions.

This PR also accommodates to web reality by aligning the 402 spec text
with the existing behavior of ICU.

This PR is stacked on top of tc39#876.
This PR updates ECMA-402 spec text to align with current ECMA-262
terminology and AOs for time zone identifiers. Changes include:

* Replaces `DefaultTimeZone`,  `CanonicalizeTimeZoneName`, and
  `IsValidTimeZoneName` with calls to current ECMA-262 abstract
   operations.
* Refactors `AvailableCanonicalTimeZones`  to call new ECMA-262 AOs, and
  renames it to `AvailablePrimaryTimeZoneIdentifiers`.
* Adds a `GetAvailableNamedTimeZoneIdentifier` AO Temporal will
  eventually merge into ECMA-262, but it's not there yet so we need a
  copy here.
* Replaces `#sec-time-zone-names with a "Use of the IANA Time Zone
  Database" section that extends ECMA-262's
  #sec-time-zone-identifiers section.
* Adds a few paragraphs of editorial recommendations (borrowed from
  Temporal) about managing updates and builds of TZDB.
justingrant added a commit to justingrant/ecma402 that referenced this pull request Apr 3, 2024
This PR resolves tc39#825 by adding spec text that defines how ECMA-402
implementations should decide which IANA time zone IDs should be
primary vs. non-primary.

This PR implements "Option C" in tc39#825 by deterministically defining
ECMAScript's exceptions from the IANA Time Zone Database's defaults,
and then pointing implementers at ICU as a convenient implementation
of those exceptions.

This PR also accommodates to web reality by aligning the 402 spec text
with the existing behavior of ICU.

This PR is stacked on top of tc39#876.
justingrant added a commit to justingrant/ecma402 that referenced this pull request Apr 3, 2024
This PR resolves tc39#825 by adding spec text that defines how ECMA-402
implementations should decide which IANA time zone IDs should be
primary vs. non-primary.

This PR implements "Option C" in tc39#825 by deterministically defining
ECMAScript's exceptions from the IANA Time Zone Database's defaults,
and then pointing implementers at ICU as a convenient implementation
of those exceptions.

This PR also accommodates to web reality by aligning the 402 spec text
with the existing behavior of ICU.

This PR is stacked on top of tc39#876.
justingrant added a commit to justingrant/ecma402 that referenced this pull request Apr 3, 2024
This PR resolves tc39#825 by adding spec text that defines how ECMA-402
implementations should decide which IANA time zone IDs should be
primary vs. non-primary.

This PR implements "Option C" in tc39#825 by deterministically defining
ECMAScript's exceptions from the IANA Time Zone Database's defaults,
and then pointing implementers at ICU as a convenient implementation
of those exceptions.

This PR also accommodates to web reality by aligning the 402 spec text
with the existing behavior of ICU.

This PR is stacked on top of tc39#876.
@justingrant
Copy link
Contributor Author

@sffc @gibson042 what is the process for ECMA-402 editorial PRs? I'd like to ideally get this reviewed before it gets too stale.

@sffc sffc requested a review from ben-allen April 18, 2024 21:26
@sffc
Copy link
Contributor

sffc commented Apr 18, 2024

The process is to get a review from @gibson042 or @ben-allen.

@justingrant
Copy link
Contributor Author

The process is to get a review from @gibson042 or @ben-allen.

@gibson042 @ben-allen Possible to review this before it gets too stale? Thanks!

Copy link
Collaborator

@ben-allen ben-allen left a comment

Choose a reason for hiding this comment

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

This seems both entirely sound and entirely clear. I trust @ptomato on all language derived from Temporal, and can't find any spec bugs.

Thank you for all your work on time zone names in general -- it's genuinely geopolitically important to get this right.

@ben-allen ben-allen merged commit 8403608 into tc39:main Apr 25, 2024
2 checks passed
ptomato added a commit to ptomato/ecma402 that referenced this pull request 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, CanonicalizeCalendar.

In Intl.supportedValuesOf(), on the other hand, we should not return all
possible aliases, so we filter them out using CanonicalizeCalendar 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, adding
CanonicalizeCollation, CanonicalizeCurrency, CanonicalizeNumberingSystem,
and CanonicalizeUnit as well.

Closes: tc39#726
justingrant added a commit to justingrant/ecma402 that referenced this pull request May 22, 2024
This PR resolves tc39#825 by adding spec text that defines how ECMA-402
implementations should decide which IANA time zone IDs should be
primary vs. non-primary.

This PR implements "Option C" in tc39#825 by deterministically defining
ECMAScript's exceptions from the IANA Time Zone Database's defaults,
and then pointing implementers at ICU as a convenient implementation
of those exceptions.

This PR also accommodates to web reality by aligning the 402 spec text
with the existing behavior of ICU.

This PR is stacked on top of tc39#876.
ptomato added a commit to ptomato/ecma402 that referenced this pull request 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, adding
CanonicalizeCollation, CanonicalizeCurrency, CanonicalizeNumberingSystem,
and CanonicalizeUnit as well.

Closes: tc39#726
gibson042 pushed a commit to ptomato/ecma402 that referenced this pull request 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
editorial Involves an editorial fix needs review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants