Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 37 additions & 7 deletions spec/abstractops.html
Original file line number Diff line number Diff line change
Expand Up @@ -1411,6 +1411,36 @@ <h1>ISO String Time Zone Parse Records</h1>
</emu-table>
</emu-clause>

<emu-clause id="sec-temporal-time-zone-identifier-parse-records">
<h1>Time Zone Identifier Parse Records</h1>
<p>A <dfn variants="Time Zone Identifier Parse Records">Time Zone Identifier Parse Record</dfn> is a Record value used to represent the result of parsing a time zone identifier either as an offset time zone or named time zone.</p>
<p>Time Zone Identifier Parse Records have the fields listed in <emu-xref href="#table-temporal-time-zone-identifier-parse-record-fields"></emu-xref>.</p>
<p>The two fields are mutually exclusive. One of them always has the value ~empty~.</p>
<emu-table id="table-temporal-time-zone-identifier-parse-record-fields" caption="Time Zone Identifier Parse Record Fields">
<table class="real-table">
<tr>
<th>Field Name</th>
<th>Value</th>
<th>Meaning</th>
</tr>
<tr>
<td>[[Name]]</td>
<td>a String or ~empty~</td>
<td>
The time zone's name (not necessarily an available named time zone identifier), or ~empty~ if the time zone is an offset time zone.
</td>
</tr>
<tr>
<td>[[OffsetMinutes]]</td>
<td>an integer in the inclusive interval from -1439 to 1439, or ~empty~</td>
<td>
The time zone's UTC offset expressed as a number of minutes, or ~empty~ if the time zone is a named time zone.
</td>
</tr>
</table>
</emu-table>
</emu-clause>

<emu-clause id="sec-temporal-iso-date-time-parse-records">
<h1>ISO Date-Time Parse Records</h1>
<p>An <dfn variants="ISO Date-Time Parse Records">ISO Date-Time Parse Record</dfn> is a Record value used to represent the result of parsing an ISO 8601 / RFC 9557 string.</p>
Expand Down Expand Up @@ -1706,20 +1736,20 @@ <h1>
<h1>
ParseTemporalTimeZoneString (
_timeZoneString_: a String,
): either a normal completion containing a Record containing information about the time zone, or a throw completion
): either a normal completion containing a Time Zone Identifier Parse Record, or a throw completion
</h1>
<dl class="header">
<dt>description</dt>
<dd>
It parses the argument as either a time zone identifier or an ISO 8601 / RFC 9557 string.
The returned Record's fields are set as follows:
<ul>
<li>If _timeZoneString_ is a named time zone identifier, then [[Name]] is _timeZoneString_ and [[OffsetMinutes]] is ~empty~.</li>
<li>Otherwise, if _timeZoneString_ is an offset time zone identifier, then [[OffsetMinutes]] is a signed integer and [[Name]] is ~empty~.</li>
<li>Otherwise, if _timeZoneString_ is a string with a time zone annotation containing a named time zone identifier, then [[Name]] is the time zone identifier contained in the annotation and [[OffsetMinutes]] is ~empty~.</li>
<li>Otherwise, if _timeZoneString_ is a string with a time zone annotation containing an offset time zone identifier, then [[OffsetMinutes]] is a signed integer and [[Name]] is ~empty~.</li>
<li>Otherwise, if _timeZoneString_ is a string using a *Z* offset designator, then [[Name]] is *"UTC"* and [[OffsetMinutes]] is ~empty~.</li>
<li>Otherwise, if _timeZoneString_ is a string using a numeric UTC offset, then [[OffsetMinutes]] is a signed integer and [[Name]] is ~empty~.</li>
<li>If _timeZoneString_ is a named time zone identifier, then [[Name]] is _timeZoneString_.</li>
<li>Otherwise, if _timeZoneString_ is an offset time zone identifier, then [[OffsetMinutes]] is the time zone's UTC offset.</li>
<li>Otherwise, if _timeZoneString_ is a string with a time zone annotation containing a named time zone identifier, then [[Name]] is the time zone identifier contained in the annotation.</li>
<li>Otherwise, if _timeZoneString_ is a string with a time zone annotation containing an offset time zone identifier, then [[OffsetMinutes]] is the time zone's UTC offset.</li>
<li>Otherwise, if _timeZoneString_ is a string using a *Z* offset designator, then [[Name]] is *"UTC"*.</li>
<li>Otherwise, if _timeZoneString_ is a string using a numeric UTC offset, then [[OffsetMinutes]] is that numeric UTC offset.</li>
<li>Otherwise, a *RangeError* is thrown.</li>
</ul>
</dd>
Expand Down
1 change: 0 additions & 1 deletion spec/intl.html
Original file line number Diff line number Diff line change
Expand Up @@ -452,7 +452,6 @@ <h1>
1. <del>If _parseResult_ contains more than one |MinuteSecond| Parse Node, throw a *RangeError* exception.</del>
1. Let _offsetNanoseconds_ be <del>ParseTimeZoneOffsetString</del><ins>? ParseDateTimeUTCOffset</ins>(_timeZone_).
1. Let _offsetMinutes_ be _offsetNanoseconds_ / (6 × 10<sup>10</sup>).
1. Assert: _offsetMinutes_ is an integer.
1. Set _timeZone_ to FormatOffsetTimeZoneIdentifier(_offsetMinutes_).
1. <del>Else if IsValidTimeZoneName(_timeZone_) is *true*, then</del>
1. <ins>Else,</ins>
Expand Down
2 changes: 1 addition & 1 deletion spec/mainadditions.html
Original file line number Diff line number Diff line change
Expand Up @@ -695,7 +695,7 @@ <h1>
<h1>
ParseDateTimeUTCOffset (
_offsetString_: a String
): either a normal completion containing an integer or a throw completion
): either a normal completion containing an integer in the interval from -86400 × 10<sup>9</sup> (exclusive) to 86400 × 10<sup>9</sup> (exclusive), or a throw completion
</h1>
</ins>
<dl class="header">
Expand Down
1 change: 1 addition & 0 deletions spec/plaindate.html
Original file line number Diff line number Diff line change
Expand Up @@ -571,6 +571,7 @@ <h1>ISO Date Records</h1>
<p>
An <dfn variants="ISO Date Records">ISO Date Record</dfn> is a Record value used to represent a valid calendar date in the ISO 8601 calendar, although the year may be outside of the allowed range for Temporal.
ISO Date Records are produced by the abstract operation CreateISODateRecord.
For any ISO Date Record _d_, IsValidISODate(_d_.[[Year]], _d_.[[Month]], _d_.[[Day]]) must return *true*.
</p>
<p>ISO Date Records have the fields listed in <emu-xref href="#table-temporal-iso-date-record-fields"></emu-xref>.</p>
<emu-table id="table-temporal-iso-date-record-fields" caption="ISO Date Record Fields">
Expand Down
2 changes: 1 addition & 1 deletion spec/plaindatetime.html
Original file line number Diff line number Diff line change
Expand Up @@ -678,7 +678,7 @@ <h1>Abstract Operations</h1>
<h1>ISO Date-Time Records</h1>
<p>
An <dfn variants="ISO Date-Time Records">ISO Date-Time Record</dfn> is a Record value used to represent a valid calendar date in the ISO 8601 calendar together with a clock time.
For any ISO Date-Time Record _r_, IsValidISODate(_r_.[[ISODate]].[[Year]], _r_.[[ISODate]][[Month]], _r_.[[ISODate]].[[Day]]) must return *true*, and IsValidTime(_r_.[[Time]].[[Hour]], _r_.[[Time]].[[Minute]], _r_.[[Time]].[[Second]], _r_.[[Time]].[[Millisecond]], _r_.[[Time]].[[Microsecond]], _r_.[[Time]].[[Nanosecond]]) must return *true*.
For any ISO Date-Time Record _r_, IsValidISODate(_r_.[[ISODate]].[[Year]], _r_.[[ISODate]].[[Month]], _r_.[[ISODate]].[[Day]]) must return *true*, and IsValidTime(_r_.[[Time]].[[Hour]], _r_.[[Time]].[[Minute]], _r_.[[Time]].[[Second]], _r_.[[Time]].[[Millisecond]], _r_.[[Time]].[[Microsecond]], _r_.[[Time]].[[Nanosecond]]) must return *true*.
It is not necessary for ISODateTimeWithinLimits(_r_) to return *true*.
</p>
<p>ISO Date-Time Records have the fields listed in <emu-xref href="#table-temporal-iso-date-time-record-fields"></emu-xref>.</p>
Expand Down
6 changes: 3 additions & 3 deletions spec/plaintime.html
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,7 @@ <h1>Properties of Temporal.PlainTime Instances</h1>
[[Time]]
</td>
<td>
A Time Record.
A Time Record. The [[Days]] field is ignored.
</td>
</tr>
</table>
Expand All @@ -409,7 +409,7 @@ <h1>Time Records</h1>
</tr>
<tr>
<td>[[Days]]</td>
<td>an integer ≥ 0</td>
<td>an integer</td>
<td>A number of overflow days.</td>
</tr>
<tr>
Expand Down Expand Up @@ -455,7 +455,7 @@ <h1>
_millisecond_: an integer in the inclusive interval from 0 to 999,
_microsecond_: an integer in the inclusive interval from 0 to 999,
_nanosecond_: an integer in the inclusive interval from 0 to 999,
optional _deltaDays_: a non-negative integer,
optional _deltaDays_: an integer,
): a Time Record
</h1>
<dl class="header">
Expand Down
18 changes: 7 additions & 11 deletions spec/timezone.html
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ <h1>
<emu-clause id="sec-temporal-formatoffsettimezoneidentifier" type="abstract operation">
<h1>
FormatOffsetTimeZoneIdentifier (
_offsetMinutes_: an integer,
_offsetMinutes_: an integer in the inclusive interval from -1439 to 1439,
optional _style_: ~separated~ or ~unseparated~,
): an offset time zone identifier
</h1>
Expand All @@ -158,7 +158,7 @@ <h1>
<emu-clause id="sec-temporal-formatutcoffsetnanoseconds" type="abstract operation">
<h1>
FormatUTCOffsetNanoseconds (
_offsetNanoseconds_: an integer,
_offsetNanoseconds_: an integer in the interval from -86400 × 10<sup>9</sup> (exclusive) to 86400 × 10<sup>9</sup> (exclusive),
): a String
</h1>
<dl class="header">
Expand All @@ -184,7 +184,7 @@ <h1>
<emu-clause id="sec-temporal-formatdatetimeutcoffsetrounded" type="abstract operation">
<h1>
FormatDateTimeUTCOffsetRounded (
_offsetNanoseconds_: an integer,
_offsetNanoseconds_: an integer in the interval from -86400 × 10<sup>9</sup> (exclusive) to 86400 × 10<sup>9</sup> (exclusive),
): a String
</h1>
<dl class="header">
Expand All @@ -194,7 +194,6 @@ <h1>
<emu-alg>
1. Set _offsetNanoseconds_ to RoundNumberToIncrement(_offsetNanoseconds_, 60 × 10<sup>9</sup>, ~half-expand~).
1. Let _offsetMinutes_ be _offsetNanoseconds_ / (60 × 10<sup>9</sup>).
1. Assert: _offsetMinutes_ is an integer.
1. Return FormatOffsetTimeZoneIdentifier(_offsetMinutes_).
</emu-alg>
</emu-clause>
Expand Down Expand Up @@ -418,14 +417,12 @@ <h1>
<h1>
ParseTimeZoneIdentifier (
_identifier_: a String,
): either a normal completion containing a Record with fields [[Name]] (a named time zone identifier or ~empty~) and [[OffsetMinutes]] (an integer or ~empty~), or a throw completion
): either a normal completion containing a Time Zone Identifier Parse Record, or a throw completion
</h1>
<dl class="header">
<dt>description</dt>
<dd>
If _identifier_ is a named time zone identifier, [[Name]] will be _identifier_ and [[OffsetMinutes]] will be ~empty~.
If _identifier_ is an offset time zone identifier, [[Name]] will be ~empty~ and [[OffsetMinutes]] will be a signed integer.
Otherwise, a *RangeError* will be thrown.
It parses _identifier_ to determine whether it identifies an offset time zone or named time zone. If _identifier_ is syntactically invalid, a *RangeError* will be thrown.
</dd>
</dl>
<emu-alg>
Expand All @@ -434,14 +431,13 @@ <h1>
1. If _parseResult_ contains a |TimeZoneIANAName| Parse Node, then
1. Let _name_ be the source text matched by the |TimeZoneIANAName| Parse Node contained within _parseResult_.
1. NOTE: _name_ is syntactically valid, but does not necessarily conform to <a href="https://data.iana.org/time-zones/theory.html#naming">IANA Time Zone Database naming guidelines</a> or correspond with an available named time zone identifier.
1. Return the Record { [[Name]]: CodePointsToString(_name_), [[OffsetMinutes]]: ~empty~ }.
1. Return Time Zone Identifier Parse Record { [[Name]]: CodePointsToString(_name_), [[OffsetMinutes]]: ~empty~ }.
1. Else,
1. Assert: _parseResult_ contains a |UTCOffset[~SubMinutePrecision]| Parse Node.
1. Let _offset_ be the source text matched by the |UTCOffset[~SubMinutePrecision]| Parse Node contained within _parseResult_.
1. Let _offsetNanoseconds_ be ! ParseDateTimeUTCOffset(CodePointsToString(_offset_)).
1. Let _offsetMinutes_ be _offsetNanoseconds_ / (60 × 10<sup>9</sup>).
1. Assert: _offsetMinutes_ is an integer.
1. Return the Record { [[Name]]: ~empty~, [[OffsetMinutes]]: _offsetMinutes_ }.
1. Return Time Zone Identifier Parse Record { [[Name]]: ~empty~, [[OffsetMinutes]]: _offsetMinutes_ }.
</emu-alg>
</emu-clause>
</emu-clause>
Expand Down
2 changes: 1 addition & 1 deletion spec/zoneddatetime.html
Original file line number Diff line number Diff line change
Expand Up @@ -887,7 +887,7 @@ <h1>
_isoDate_: an ISO Date Record,
_time_: a Time Record or ~start-of-day~,
_offsetBehaviour_: ~option~, ~exact~, or ~wall~,
_offsetNanoseconds_: an integer,
_offsetNanoseconds_: an integer in the interval from -86400 × 10<sup>9</sup> (exclusive) to 86400 × 10<sup>9</sup> (exclusive),
_timeZone_: an available time zone identifier,
_disambiguation_: ~earlier~, ~later~, ~compatible~, or ~reject~,
_offsetOption_: ~ignore~, ~use~, ~prefer~, or ~reject~,
Expand Down