Skip to content

Commit

Permalink
Specify ZonedDateTime.toPlain{YearMonth,MonthDay}()
Browse files Browse the repository at this point in the history
See: #569
  • Loading branch information
ptomato committed Nov 7, 2020
1 parent 3fd62a1 commit 93e0d22
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions spec/zoneddatetime.html
Original file line number Diff line number Diff line change
Expand Up @@ -888,7 +888,12 @@ <h1>Temporal.ZonedDateTime.prototype.toPlainYearMonth ( )</h1>
1. Let _timeZone_ be _zonedDateTime_.[[TimeZone]].
1. Let _instant_ be ? CreateTemporalInstant(_zonedDateTime_.[[Nanoseconds]]).
1. Let _temporalDateTime_ be ? GetTemporalDateTimeFor(_timeZone_, _instant_).
1. Return ? <mark>create via `calendar.yearMonthFromFields()`</mark>.
1. Let _calendar_ be _zonedDateTime_.[[Calendar]].
1. Let _fieldNames_ be ? CalendarFields(_calendar_, « *"day"*, *"month"*, *"year"* »).
1. Let _fields_ be ? ToTemporalDateFields(_temporalDateTime_, _fieldNames_).
1. Let _yearMonthFromFields_ be ? Get(_calendar_, *"yearMonthFromFields"*).
1. Let _options_ be ? OrdinaryObjectCreate(%Object.prototype%).
1. Return ? Call(_yearMonthFromFields_, _calendar_, « _fields_, _options_, %Temporal.PlainMonthDay% »).
</emu-alg>
</emu-clause>

Expand All @@ -903,7 +908,12 @@ <h1>Temporal.ZonedDateTime.prototype.toPlainMonthDay ( )</h1>
1. Let _timeZone_ be _zonedDateTime_.[[TimeZone]].
1. Let _instant_ be ? CreateTemporalInstant(_zonedDateTime_.[[Nanoseconds]]).
1. Let _temporalDateTime_ be ? GetTemporalDateTimeFor(_timeZone_, _instant_).
1. Return ? <mark>create via `calendar.monthDayFromFields()`</mark>.
1. Let _calendar_ be _zonedDateTime_.[[Calendar]].
1. Let _fieldNames_ be ? CalendarFields(_calendar_, « *"day"*, *"month"*, *"year"* »).
1. Let _fields_ be ? ToTemporalDateFields(_temporalDateTime_, _fieldNames_).
1. Let _monthDayFromFields_ be ? Get(_calendar_, *"monthDayFromFields"*).
1. Let _options_ be ? OrdinaryObjectCreate(%Object.prototype%).
1. Return ? Call(_monthDayFromFields_, _calendar_, « _fields_, _options_, %Temporal.PlainMonthDay% »).
</emu-alg>
</emu-clause>

Expand Down

0 comments on commit 93e0d22

Please sign in to comment.