Skip to content

Commit

Permalink
Normative: Allow implementations to report their time zone as a UTC o…
Browse files Browse the repository at this point in the history
…ffset

This aligns with ECMA-262, and therefore removes the DefaultTimeZone override.
  • Loading branch information
gibson042 authored and ryzokuken committed Sep 27, 2023
1 parent 3ef4558 commit 896ffcc
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 19 deletions.
3 changes: 0 additions & 3 deletions spec/annexes.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,6 @@ <h1>Implementation Dependent Behaviour</h1>
<li>
The default locale (<emu-xref href="#sec-defaultlocale"></emu-xref>)
</li>
<li>
The default time zone (<emu-xref href="#sup-defaulttimezone"></emu-xref>)
</li>
<li>
The set of available locales for each constructor (<emu-xref href="#sec-internal-slots"></emu-xref>)
</li>
Expand Down
8 changes: 6 additions & 2 deletions spec/datetimeformat.html
Original file line number Diff line number Diff line change
Expand Up @@ -679,7 +679,7 @@ <h1>Properties of Intl.DateTimeFormat Instances</h1>
<li>[[Locale]] is a String value with the language tag of the locale whose localization is used for formatting.</li>
<li>[[Calendar]] is a String value representing the <a href="https://unicode.org/reports/tr35/#UnicodeCalendarIdentifier">Unicode Calendar Identifier</a> used for formatting.</li>
<li>[[NumberingSystem]] is a String value representing the <a href="https://unicode.org/reports/tr35/#UnicodeNumberSystemIdentifier">Unicode Number System Identifier</a> used for formatting.</li>
<li>[[TimeZone]] is a String value that is a time zone identifier from the IANA Time Zone Database used for formatting.</li>
<li>[[TimeZone]] is a String value used for formatting that is either a time zone identifier from the IANA Time Zone Database or a UTC offset in ISO 8601 extended format.</li>
<li>[[Weekday]], [[Era]], [[Year]], [[Month]], [[Day]], [[DayPeriod]], [[Hour]], [[Minute]], [[Second]], [[TimeZoneName]] are each either *undefined*, indicating that the component is not used for formatting, or one of the String values given in <emu-xref href="#table-datetimeformat-components"></emu-xref>, indicating how the component should be presented in the formatted output.</li>
<li>[[FractionalSecondDigits]] is either *undefined* or a positive, non-zero integer Number value indicating the fraction digits to be used for fractional seconds. Numbers will be rounded or padded with trailing zeroes if necessary.</li>
<li>[[HourCycle]] is a String value indicating whether the 12-hour format (*"h11"*, *"h12"*) or the 24-hour format (*"h23"*, *"h24"*) should be used. *"h11"* and *"h23"* start with hour 0 and go up to 11 and 23 respectively. *"h12"* and *"h24"* start with hour 1 and go up to 12 and 24. [[HourCycle]] is only used when [[Hour]] is not *undefined*.</li>
Expand Down Expand Up @@ -1150,7 +1150,11 @@ <h1>
</dl>

<emu-alg>
1. Let _offsetNs_ be GetNamedTimeZoneOffsetNanoseconds(_timeZoneIdentifier_, _epochNs_).
1. If IsTimeZoneOffsetString(_timeZoneIdentifier_) is *true*, then
1. Let _offsetNs_ be ParseTimeZoneOffsetString(_timeZoneIdentifier_).
1. Else,
1. Assert: IsValidTimeZoneName(_timeZoneIdentifier_) is *true*.
1. Let _offsetNs_ be GetNamedTimeZoneOffsetNanoseconds(_timeZoneIdentifier_, _epochNs_).
1. Let _tz_ be ℝ(_epochNs_) + _offsetNs_.
1. If _calendar_ is *"gregory"*, then
1. Return a record with fields calculated from _tz_ according to <emu-xref href="#table-datetimeformat-tolocaltime-record"></emu-xref>.
Expand Down
15 changes: 1 addition & 14 deletions spec/locales-currencies-tz.html
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ <h1>IsValidTimeZoneName ( _timeZone_ )</h1>
</emu-clause>

<emu-note>
Any value returned from DefaultTimeZone must be recognized as valid.
Any value returned from DefaultTimeZone that is not recognized as valid by IsTimeZoneOffsetString must be recognized as valid by IsValidTimeZoneName.
</emu-note>

<emu-clause id="sec-canonicalizetimezonename" type="abstract operation">
Expand All @@ -203,19 +203,6 @@ <h1>
</emu-alg>
</emu-clause>

<emu-clause id="sup-defaulttimezone" oldids="sec-defaulttimezone" type="implementation-defined abstract operation">
<h1>DefaultTimeZone ( ): a String</h1>

<dl class="header">
<dt>description</dt>
<dd>It returns a String value representing the host environment's current time zone, which is a valid (<emu-xref href="#sec-isvalidtimezonename"></emu-xref>) and canonicalized (<emu-xref href="#sec-canonicalizetimezonename"></emu-xref>) time zone name.</dd>
</dl>

<p>
This definition supersedes the definition provided in es2024, <emu-xref href="#sec-defaulttimezone"></emu-xref>.
</p>
</emu-clause>

<emu-clause id="sec-availablecanonicaltimezones" type="implementation-defined abstract operation">
<h1>
AvailableCanonicalTimeZones (
Expand Down

0 comments on commit 896ffcc

Please sign in to comment.