Skip to content

Commit

Permalink
Skeleton ZonedDateTime specification
Browse files Browse the repository at this point in the history
This is a spec page which has all the correct entries for ZonedDateTime,
although many of them are marked TODO.

See: #569
  • Loading branch information
ptomato committed Oct 24, 2020
1 parent b364d76 commit 6acad7c
Show file tree
Hide file tree
Showing 5 changed files with 1,071 additions and 0 deletions.
1 change: 1 addition & 0 deletions spec.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ <h1>Introduction</h1>
<emu-import href="spec/date.html"></emu-import>
<emu-import href="spec/time.html"></emu-import>
<emu-import href="spec/datetime.html"></emu-import>
<emu-import href="spec/zoneddatetime.html"></emu-import>
<emu-import href="spec/duration.html"></emu-import>
<emu-import href="spec/instant.html"></emu-import>
<emu-import href="spec/yearmonth.html"></emu-import>
Expand Down
11 changes: 11 additions & 0 deletions spec/abstractops.html
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,17 @@ <h1>ToTemporalRoundingMode ( _normalizedOptions_, _fallback_ )</h1>
</emu-alg>
</emu-clause>

<emu-clause id="sec-temporal-totemporaloffset" aoid="ToTemporalOffset">
<h1>ToTemporalOffset ( _normalizedOptions_, _fallback_ )</h1>
<p>
The abstract operation ToTemporalOffset extracts the value of the property named *"offset"* from _normalizedOptions_ and makes sure it is a valid value for the option.
The value _fallback_ is returned if the property is not present.
</p>
<emu-alg>
1. Return ? GetOption(_normalizedOptions_, *"offset"*, *"string"*, « *"prefer"*, *"use"*, *"ignore"*, *"reject"* », _fallback_).
</emu-alg>
</emu-clause>

<emu-clause id="sec-temporal-totemporalroundingincrement" aoid="ToTemporalRoundingIncrement">
<h1>ToTemporalRoundingIncrement ( _normalizedOptions_, _dividend_, _inclusive_ )</h1>
<emu-alg>
Expand Down
11 changes: 11 additions & 0 deletions spec/intl.html
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,11 @@ <h1>InitializeDateTimeFormat ( _dateTimeFormat_, _locales_, _options_ )</h1>
<td>[[weekday]], [[era]], [[year]], [[month]], [[day]], [[hour]], [[minute]], [[second]], [[dayPeriod]], [[fractionalSecondDigits]]</td>
<td>[[year]], [[month]], [[day]], [[hour]], [[minute]], [[second]]</td>
</tr>
<tr>
<th>[[TemporalZonedDateTimePattern]]</th>
<td>[[weekday]], [[era]], [[year]], [[month]], [[day]], [[hour]], [[minute]], [[second]], [[dayPeriod]], [[fractionalSecondDigits]], [[timeZoneName]]</td>
<td>[[year]], [[month]], [[day]], [[hour]], [[minute]], [[second]], [[timeZoneName]]</td>
</tr>
</tbody>
</table>
</emu-table>
Expand Down Expand Up @@ -309,6 +314,12 @@ <h1>PartitionDateTimePattern ( _dateTimeFormat_, _x_ )</h1>
1. <ins>If _calendar_ is not *"iso8601"* and not equal to _dateTimeFormat_.[[Calendar]], throw a *RangeError* exception.</ins>
1. <ins>Let _pattern_ be _dateTimeFormat_.[[TemporalDateTimePattern]].</ins>
1. <ins>Let _tm_ be { [[weekday]]: ToDayOfWeek(_x_.[[ISOYear]], _x_.[[ISOMonth]], _x_.[[ISODay]]), [[year]]: _x_.[[ISOYear]], [[month]]: _x_.[[ISOMonth]], [[day]]: _x_.[[ISODay]], [[hour]]: _x_.[[Hour]], [[minute]]: _x_.[[Minute]], [[second]]: _x_.[[Second]] }.</ins>
1. <ins>If _date_ has an [[InitializedTemporalZonedDateTime]] internal slot, then</ins>
1. <ins>Let _calendar_ be ? CalendarToString(_x_).</ins>
1. <ins>If _calendar_ is not *"iso8601"* and not equal to _dateTimeFormat_.[[Calendar]], then</ins>
1. <ins>Throw a *RangeError* exception.</ins>
1. <ins>Let _pattern_ be _dateTimeFormat_.[[TemporalZonedDateTimePattern]].</ins>
1. <ins>Let _tm_ be { [[weekday]]: <mark>TODO</mark>, [[year]]: <mark>TODO</mark>, [[month]]: <mark>TODO</mark>, [[day]]: <mark>TODO</mark>, [[hour]]: <mark>TODO</mark>, [[minute]]: <mark>TODO</mark>, [[second]]: <mark>TODO</mark>, [[timeZoneName]]: ? TimeZoneToString(_date_) }.
1. <ins>If _pattern_ is *null*, throw a *TypeError* exception.</ins>
1. <ins>Else,</ins>
1. <ins>Let _pattern_ be _dateTimeFormat_.[[Pattern]].</ins>
Expand Down
31 changes: 31 additions & 0 deletions spec/timezone.html
Original file line number Diff line number Diff line change
Expand Up @@ -490,5 +490,36 @@ <h1>ParseOffsetNanoseconds ( _identifier_ )</h1>
1. Return _sign_ × (_hours_ × 60 + _minutes_) × 60 × 1,000,000,000.
</emu-alg>
</emu-clause>

<emu-clause id="sec-temporal-comparetimezone" aoid="CompareTimeZone">
<p>
The abstract operation CompareTimeZone lexicographically compares the
results of calling `toString()` on its arguments.
</p>
<h1>CompareTimeZone ( _one_, _two_ )</h1>
<emu-alg>
1. Let _calendarOne_ be ? TimeZoneToString(_one_).
1. Let _calendarTwo_ be ? TimeZoneToString(_two_).
1. Let _r_ be the result of performing Abstract Relational Comparison _timeZoneOne_ &lt; _timeZoneTwo_.
1. If _r_ is *true*, return −1.
1. Let _r_ be the result of performing Abstract Relational Comparison _timeZoneTwo_ &lt; _timeZoneOne_.
1. If _r_ is *true*, return 1.
1. Return 0.
</emu-alg>
</emu-clause>

<emu-clause id="sec-temporal-timezoneequals" aoid="TimeZoneEquals">
<h1>TimeZoneEquals ( _one_, _two_ )</h1>
<p>
The abstract operation TimeZoneEquals returns *true* if the results of
calling `toString()` on its arguments are equal.
</p>
<emu-alg>
1. Let _timeZoneOne_ be ? TimeZoneToString(_one_).
1. Let _timeZoneTwo_ be ? TimeZoneToString(_two_).
1. If _timeZoneOne_ is _timeZoneTwo_, return *true*.
1. Return *false*.
</emu-alg>
</emu-clause>
</emu-clause>
</emu-clause>
Loading

0 comments on commit 6acad7c

Please sign in to comment.