Skip to content

Commit 127dce2

Browse files
committed
Editorial: Pass ISO Date-Time Record to InterpretISODateTimeOffset
1 parent 4d93139 commit 127dce2

File tree

2 files changed

+19
-19
lines changed

2 files changed

+19
-19
lines changed

spec/abstractops.html

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -624,13 +624,11 @@ <h1>
624624
1. Return the Record { [[PlainRelativeTo]]: _plainDate_, [[ZonedRelativeTo]]: *undefined* }.
625625
1. Let _calendar_ be ? GetTemporalCalendarIdentifierWithISODefault(_value_).
626626
1. Let _fields_ be ? PrepareCalendarFields(_calendar_, _value_, « ~year~, ~month~, ~month-code~, ~day~ », « ~hour~, ~minute~, ~second~, ~millisecond~, ~microsecond~, ~nanosecond~, ~offset~, ~time-zone~ », «»).
627-
1. Let _result_ be ? InterpretTemporalDateTimeFields(_calendar_, _fields_, ~constrain~).
627+
1. Let _isoDateTime_ be ? InterpretTemporalDateTimeFields(_calendar_, _fields_, ~constrain~).
628628
1. Let _timeZone_ be _fields_.[[TimeZone]].
629629
1. Let _offsetString_ be _fields_.[[Offset]].
630630
1. If _offsetString_ is ~unset~, then
631631
1. Set _offsetBehaviour_ to ~wall~.
632-
1. Let _isoDate_ be _result_.[[ISODate]].
633-
1. Let _time_ be _result_.[[Time]].
634632
1. Else,
635633
1. If _value_ is not a String, throw a *TypeError* exception.
636634
1. Let _result_ be ? ParseISODateTime(_value_, « |TemporalDateTimeString[+Zoned]|, |TemporalDateTimeString[~Zoned]| »).
@@ -650,14 +648,20 @@ <h1>
650648
1. Set _calendar_ to ? CanonicalizeCalendar(_calendar_).
651649
1. Let _isoDate_ be CreateISODateRecord(_result_.[[Year]], _result_.[[Month]], _result_.[[Day]]).
652650
1. Let _time_ be _result_.[[Time]].
651+
1. If _time_ is ~start-of-day~, then
652+
1. If _timeZone_ is not ~unset~, then
653+
1. Assert: _offsetBehaviour_ is ~wall~.
654+
1. Return ? GetStartOfDay(_timeZone_, _isoDate_).
655+
1. Set _time_ to MidnightTimeRecord().
656+
1. Let _isoDateTime_ be CombineISODateAndTimeRecord(_isoDate_, _time_).
653657
1. If _timeZone_ is ~unset~, then
654-
1. Let _plainDate_ be ? CreateTemporalDate(_isoDate_, _calendar_).
658+
1. Let _plainDate_ be ? CreateTemporalDate(_isoDateTime_.[[ISODate]], _calendar_).
655659
1. Return the Record { [[PlainRelativeTo]]: _plainDate_, [[ZonedRelativeTo]]: *undefined* }.
656660
1. If _offsetBehaviour_ is ~option~, then
657661
1. Let _offsetNs_ be ! ParseDateTimeUTCOffset(_offsetString_).
658662
1. Else,
659663
1. Let _offsetNs_ be 0.
660-
1. Let _epochNanoseconds_ be ? InterpretISODateTimeOffset(_isoDate_, _time_, _offsetBehaviour_, _offsetNs_, _timeZone_, ~compatible~, ~reject~, _matchBehaviour_).
664+
1. Let _epochNanoseconds_ be ? InterpretISODateTimeOffset(_isoDateTime_, _offsetBehaviour_, _offsetNs_, _timeZone_, ~compatible~, ~reject~, _matchBehaviour_).
661665
1. Let _zonedRelativeTo_ be ! CreateTemporalZonedDateTime(_epochNanoseconds_, _timeZone_, _calendar_).
662666
1. Return the Record { [[PlainRelativeTo]]: *undefined*, [[ZonedRelativeTo]]: _zonedRelativeTo_ }.
663667
</emu-alg>

spec/zoneddatetime.html

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -531,7 +531,7 @@ <h1>Temporal.ZonedDateTime.prototype.with ( _temporalZonedDateTimeLike_ [ , _opt
531531
1. Let _overflow_ be ? GetTemporalOverflowOption(_resolvedOptions_).
532532
1. Let _dateTimeResult_ be ? InterpretTemporalDateTimeFields(_calendar_, _fields_, _overflow_).
533533
1. Let _newOffsetNanoseconds_ be ! ParseDateTimeUTCOffset(_fields_.[[OffsetString]]).
534-
1. Let _epochNanoseconds_ be ? InterpretISODateTimeOffset(_dateTimeResult_.[[ISODate]], _dateTimeResult_.[[Time]], ~option~, _newOffsetNanoseconds_, _timeZone_, _disambiguation_, _offset_, ~match-exactly~).
534+
1. Let _epochNanoseconds_ be ? InterpretISODateTimeOffset(_dateTimeResult_, ~option~, _newOffsetNanoseconds_, _timeZone_, _disambiguation_, _offset_, ~match-exactly~).
535535
1. Return ! CreateTemporalZonedDateTime(_epochNanoseconds_, _timeZone_, _calendar_).
536536
</emu-alg>
537537
</emu-clause>
@@ -663,7 +663,7 @@ <h1>Temporal.ZonedDateTime.prototype.round ( _roundTo_ )</h1>
663663
1. Else,
664664
1. Let _roundResult_ be RoundISODateTime(_isoDateTime_, _roundingIncrement_, _smallestUnit_, _roundingMode_).
665665
1. Let _offsetNanoseconds_ be GetOffsetNanosecondsFor(_timeZone_, _thisNs_).
666-
1. Let _epochNanoseconds_ be ? InterpretISODateTimeOffset(_roundResult_.[[ISODate]], _roundResult_.[[Time]], ~option~, _offsetNanoseconds_, _timeZone_, ~compatible~, ~prefer~, ~match-exactly~).
666+
1. Let _epochNanoseconds_ be ? InterpretISODateTimeOffset(_roundResult_, ~option~, _offsetNanoseconds_, _timeZone_, ~compatible~, ~prefer~, ~match-exactly~).
667667
1. Return ! CreateTemporalZonedDateTime(_epochNanoseconds_, _timeZone_, _calendar_).
668668
</emu-alg>
669669
</emu-clause>
@@ -883,8 +883,7 @@ <h1>Abstract Operations</h1>
883883
<emu-clause id="sec-temporal-interpretisodatetimeoffset" type="abstract operation">
884884
<h1>
885885
InterpretISODateTimeOffset (
886-
_isoDate_: an ISO Date Record,
887-
_time_: a Time Record or ~start-of-day~,
886+
_isoDateTime_: an ISO Date-Time Record,
888887
_offsetBehaviour_: ~option~, ~exact~, or ~wall~,
889888
_offsetNanoseconds_: an integer,
890889
_timeZone_: an available time zone identifier,
@@ -907,12 +906,7 @@ <h1>
907906
</dd>
908907
</dl>
909908
<emu-alg>
910-
1. Perform ? CheckISODaysRange(_isoDate_).
911-
1. If _time_ is ~start-of-day~, then
912-
1. Assert: _offsetBehaviour_ is ~wall~.
913-
1. Assert: _offsetNanoseconds_ is 0.
914-
1. Return ? GetStartOfDay(_timeZone_, _isoDate_).
915-
1. Let _isoDateTime_ be CombineISODateAndTimeRecord(_isoDate_, _time_).
909+
1. Perform ? CheckISODaysRange(_isoDateTime_.[[ISODate]]).
916910
1. If _offsetBehaviour_ is ~wall~, or _offsetBehaviour_ is ~option~ and _offsetOption_ is ~ignore~, then
917911
1. Return ? GetEpochNanosecondsFor(_timeZone_, _isoDateTime_, _disambiguation_).
918912
1. If _offsetBehaviour_ is ~exact~, or _offsetBehaviour_ is ~option~ and _offsetOption_ is ~use~, then
@@ -971,9 +965,7 @@ <h1>
971965
1. Let _disambiguation_ be ? GetTemporalDisambiguationOption(_resolvedOptions_).
972966
1. Let _offsetOption_ be ? GetTemporalOffsetOption(_resolvedOptions_, ~reject~).
973967
1. Let _overflow_ be ? GetTemporalOverflowOption(_resolvedOptions_).
974-
1. Let _result_ be ? InterpretTemporalDateTimeFields(_calendar_, _fields_, _overflow_).
975-
1. Let _isoDate_ be _result_.[[ISODate]].
976-
1. Let _time_ be _result_.[[Time]].
968+
1. Let _isoDateTime_ be ? InterpretTemporalDateTimeFields(_calendar_, _fields_, _overflow_).
977969
1. Else,
978970
1. If _item_ is not a String, throw a *TypeError* exception.
979971
1. Let _result_ be ? ParseISODateTime(_item_, « |TemporalDateTimeString[+Zoned]| »).
@@ -995,10 +987,14 @@ <h1>
995987
1. Perform ? GetTemporalOverflowOption(_resolvedOptions_).
996988
1. Let _isoDate_ be CreateISODateRecord(_result_.[[Year]], _result_.[[Month]], _result_.[[Day]]).
997989
1. Let _time_ be _result_.[[Time]].
990+
1. If _time_ is ~start-of-day~, then
991+
1. Assert: _offsetBehaviour_ is ~wall~.
992+
1. Return ? GetStartOfDay(_timeZone_, _isoDate_).
993+
1. Let _isoDateTime_ be CombineISODateAndTimeRecord(_isoDate_, _time_).
998994
1. Let _offsetNanoseconds_ be 0.
999995
1. If _offsetBehaviour_ is ~option~, then
1000996
1. Set _offsetNanoseconds_ to ! ParseDateTimeUTCOffset(_offsetString_).
1001-
1. Let _epochNanoseconds_ be ? InterpretISODateTimeOffset(_isoDate_, _time_, _offsetBehaviour_, _offsetNanoseconds_, _timeZone_, _disambiguation_, _offsetOption_, _matchBehaviour_).
997+
1. Let _epochNanoseconds_ be ? InterpretISODateTimeOffset(_isoDateTime_, _offsetBehaviour_, _offsetNanoseconds_, _timeZone_, _disambiguation_, _offsetOption_, _matchBehaviour_).
1002998
1. Return ! CreateTemporalZonedDateTime(_epochNanoseconds_, _timeZone_, _calendar_).
1003999
</emu-alg>
10041000
</emu-clause>

0 commit comments

Comments
 (0)