diff --git a/spec/abstractops.html b/spec/abstractops.html index c600efc4f5..b7fb9e91bb 100644 --- a/spec/abstractops.html +++ b/spec/abstractops.html @@ -470,7 +470,7 @@

ToRelativeTemporalObject ( _options_ )

1. Let _timeZone_ be *undefined*. 1. Else, 1. If IsTimeZoneOffsetString(_timeZoneName_) is *false*, then - 1. If ! IsValidTimeZoneName(_timeZoneName_) is *false*, throw a *RangeError* exception. + 1. If IsValidTimeZoneName(_timeZoneName_) is *false*, throw a *RangeError* exception. 1. Set _timeZoneName_ to ! CanonicalizeTimeZoneName(_timeZoneName_). 1. Let _timeZone_ be ! CreateTemporalTimeZone(_timeZoneName_). 1. If _result_.[[TimeZone]].[[Z]] is *true*, then diff --git a/spec/intl.html b/spec/intl.html index a7d3494942..27fee58be4 100644 --- a/spec/intl.html +++ b/spec/intl.html @@ -32,22 +32,21 @@

Time Zone Namesonly such names), and use best available current and historical information about their offsets from UTC and their daylight saving time rules in calculations. However, the set of combinations of time zone name and language tag for which localized time zone names are available is implementation dependent.

- -

IsValidTimeZoneName ( _timeZone_ )

+ + +

IsValidTimeZoneName ( _timeZone_ )

- -

This definition supersedes the definition provided in .

-
-

- The abstract operation IsValidTimeZoneName takes argument _timeZone_, a String value, and verifies that it represents a valid Zone or Link name of the IANA Time Zone Database. -

+

+ The abstract operation IsValidTimeZoneName takes argument _timeZone_, a String value, and verifies that it represents a valid Zone or Link name of the IANA Time Zone Database. +

- - 1. If one of the Zone or Link names of the IANA Time Zone Database is an ASCII-case-insensitive match of _timeZone_, return *true*. - 1. If _timeZone_ is an ASCII-case-insensitive match of *"UTC"*, return *true*. - 1. Return *false*. - -
+ + 1. If one of the Zone or Link names of the IANA Time Zone Database is an ASCII-case-insensitive match of _timeZone_, return *true*. + 1. If _timeZone_ is an ASCII-case-insensitive match of *"UTC"*, return *true*. + 1. Return *false*. + +
+

@@ -73,6 +72,30 @@

This definition supersedes the definition provided in .

+ + + +

+ AvailableTimeZones ( + ): a List of Strings +

+
+
description
+
The returned List is a sorted List of supported Zone and Link names in the IANA Time Zone Database.
+
redefinition
+
true
+
+ + 1. Let _timeZones_ be a List containing the String value of each Zone or Link name in the IANA Time Zone Database that is supported by the implementation. + 1. Assert: _timeZones_ contains *"UTC"*. + 1. Assert: _timeZones_ does not contain any element that does not identify a Zone or Link name in the IANA Time Zone Database. + 1. Sort _timeZones_ in order as if an Array of the same values had been sorted using %Array.prototype.sort% with *undefined* as _comparefn_. + 1. Return _timeZones_. + + +

This definition supersedes the definition provided in .

+
+
@@ -193,7 +216,7 @@

InitializeDateTimeFormat ( _dateTimeFormat_, _locales_, _options_ )

1. Set _timeZone_ to DefaultTimeZone(). 1. Else, 1. Set _timeZone_ to ? ToString(_timeZone_). - 1. If the result of ! IsValidTimeZoneName(_timeZone_) is *false*, then + 1. If the result of IsValidTimeZoneName(_timeZone_) is *false*, then 1. Throw a *RangeError* exception. 1. Set _timeZone_ to ! CanonicalizeTimeZoneName(_timeZone_). 1. Set _dateTimeFormat_.[[TimeZone]] to _timeZone_. diff --git a/spec/timezone.html b/spec/timezone.html index 2e08935cff..c3b49652df 100644 --- a/spec/timezone.html +++ b/spec/timezone.html @@ -38,26 +38,23 @@

Time Zone Names

IsValidTimeZoneName ( _timeZone_: a String, - ) + ): a Boolean

description
-
It returns *true* if _timeZone_ is an ASCII-case-insensitive match for a built-in time zone name and *false* otherwise.
+
The returned value is *true* if _timeZone_ is an ASCII-case-insensitive match for a supported time zone name, and *false* otherwise.
-

- An ECMAScript implementation that includes the ECMA-402 Internationalization API must implement the IsValidTimeZoneName abstract operation as specified in the ECMA-402 specification. -

Once IsValidTimeZoneName(_timeZone_) has returned *true*, for the lifetime of the surrounding agent, IsValidTimeZoneName(_variant_) must return *true* if _variant_ is an ASCII-case-insensitive match for either _timeZone_ or CanonicalizeTimeZoneName(_timeZone_).

For the purposes of this section, a String value _A_ is an ASCII-case-insensitive match for String value _B_ if the String value derived from _A_ by replacing each occurrence of a lowercase ASCII letter code unit (0x0061 through 0x007A, inclusive) with the corresponding uppercase ASCII letter code unit (0x0041 through 0x005A, inclusive) while preserving all other code units is exactly the same sequence of code units as the String value that is derived from _B_ in the same way.

-

The minimum implementation of IsValidTimeZoneName for ECMAScript implementations that do not include the ECMA-402 API, supporting only the *"UTC"* time zone, performs the following steps when called: -

- 1. If _timeZone_ is an ASCII-case-insensitive match for *"UTC"*, return *true*. + 1. Let _timeZones_ be AvailableTimeZones(). + 1. For each String _candidate_ in _timeZones_, do + 1. If _timeZone_ is an ASCII-case-insensitive match for _candidate_, return *true*. 1. Return *false*.
@@ -84,6 +81,31 @@

1. Return *"UTC"*. + + +

+ AvailableTimeZones ( + ): a List of Strings +

+
+
description
+
The returned List is a sorted List of identifiers for time zones for which the implementation includes local political rules, and aliases for those identifiers.
+
+ +

+ An ECMAScript implementation that includes the ECMA-402 Internationalization API must implement the AvailableTimeZones abstract operation as specified in the ECMA-402 specification. + If an ECMAScript implementation does not include the ECMA-402 API the following specification of the AvailableTimeZones abstract operation is used. +

+ + 1. Let _timeZones_ be the List of String values representing time zones supported by the implementation. + 1. Assert: _timeZones_ contains *"UTC"*. + 1. Sort _timeZones_ in order as if an Array of the same values had been sorted using %Array.prototype.sort% with *undefined* as _comparefn_. + 1. Return _timeZones_. + +

+ For example, an ECMAScript implementation that does not include local political rules for any time zone could return a List with the single String *"UTC"* here. +

+
@@ -114,7 +136,7 @@

Temporal.TimeZone ( _identifier_ )

1. Throw a *TypeError* exception. 1. Set _identifier_ to ? ToString(_identifier_). 1. If IsTimeZoneOffsetString(_identifier_) is *false*, then - 1. If ! IsValidTimeZoneName(_identifier_) is *false*, then + 1. If IsValidTimeZoneName(_identifier_) is *false*, then 1. Throw a *RangeError* exception. 1. Set _identifier_ to ! CanonicalizeTimeZoneName(_identifier_). 1. Return ? CreateTemporalTimeZone(_identifier_, NewTarget). @@ -515,7 +537,7 @@

ToTemporalTimeZone ( _temporalTimeZoneLike_ )

1. If _parseResult_.[[Name]] is not *undefined*, then 1. Let _name_ be _parseResult_.[[Name]]. 1. If IsTimeZoneOffsetString(_name_) is *false*, then - 1. If ! IsValidTimeZoneName(_name_) is *false*, throw a *RangeError* exception. + 1. If IsValidTimeZoneName(_name_) is *false*, throw a *RangeError* exception. 1. Set _name_ to ! CanonicalizeTimeZoneName(_name_). 1. Return ! CreateTemporalTimeZone(_name_). 1. If _parseResult_.[[Z]] is *true*, return ! CreateTemporalTimeZone(*"UTC"*). diff --git a/spec/zoneddatetime.html b/spec/zoneddatetime.html index 7df97c5205..e5d0e02018 100644 --- a/spec/zoneddatetime.html +++ b/spec/zoneddatetime.html @@ -1115,7 +1115,7 @@

1. Let _timeZoneName_ be _result_.[[TimeZone]].[[Name]]. 1. Assert: _timeZoneName_ is not *undefined*. 1. If IsTimeZoneOffsetString(_timeZoneName_) is *false*, then - 1. If ! IsValidTimeZoneName(_timeZoneName_) is *false*, throw a *RangeError* exception. + 1. If IsValidTimeZoneName(_timeZoneName_) is *false*, throw a *RangeError* exception. 1. Set _timeZoneName_ to ! CanonicalizeTimeZoneName(_timeZoneName_). 1. Let _offsetString_ be _result_.[[TimeZone]].[[OffsetString]]. 1. If _result_.[[TimeZone]].[[Z]] is *true*, then