diff --git a/spec/abstractops.html b/spec/abstractops.html index 45f64b6a1..0d6e0245c 100644 --- a/spec/abstractops.html +++ b/spec/abstractops.html @@ -1520,11 +1520,10 @@

1. Let _microsecondMV_ be 0. 1. Let _nanosecondMV_ be 0. 1. Assert: IsValidISODate(_yearMV_, _monthMV_, _dayMV_) is *true*. - 1. Assert: IsValidTime(_hourMV_, _minuteMV_, _secondMV_, _millisecondMV_, _microsecondMV_, _nanosecondMV_) is *true*. 1. If _hour_ is empty, then 1. Let _time_ be ~start-of-day~. 1. Else, - 1. Let _time_ be Time Record { [[Days]]: 0, [[Hour]]: _hourMV_, [[Minute]]: _minuteMV_, [[Second]]: _secondMV_, [[Millisecond]]: _millisecondMV_, [[Microsecond]]: _microsecondMV_, [[Nanosecond]]: _nanosecondMV_ }. + 1. Let _time_ be CreateTimeRecord(_hourMV_, _minuteMV_, _secondMV_, _millisecondMV_, _microsecondMV_, _nanosecondMV_). 1. Let _timeZoneResult_ be ISO String Time Zone Parse Record { [[Z]]: *false*, [[OffsetString]]: ~empty~, [[TimeZoneAnnotation]]: ~empty~ }. 1. If _parseResult_ contains a |TimeZoneIdentifier| Parse Node, then 1. Let _identifier_ be the source text matched by the |TimeZoneIdentifier| Parse Node contained within _parseResult_. diff --git a/spec/plaindatetime.html b/spec/plaindatetime.html index 890512199..4111edd22 100644 --- a/spec/plaindatetime.html +++ b/spec/plaindatetime.html @@ -44,7 +44,7 @@

Temporal.PlainDateTime ( _isoYear_, _isoMonth_, _isoDay_ [ , _hour_ [ , _min 1. If IsValidISODate(_isoYear_, _isoMonth_, _isoDay_) is *false*, throw a *RangeError* exception. 1. Let _isoDate_ be CreateISODateRecord(_isoYear_, _isoMonth_, _isoDay_). 1. If IsValidTime(_hour_, _minute_, _second_, _millisecond_, _microsecond_, _nanosecond_) is *false*, throw a *RangeError* exception. - 1. Let _time_ be Time Record { [[Hour]]: _hour_, [[Minute]]: _minute_, [[Second]]: _second_, [[Millisecond]]: _millisecond_, [[Microsecond]]: _microsecond_, [[Nanosecond]]: _nanosecond_ }. + 1. Let _time_ be CreateTimeRecord(_hour_, _minute_, _second_, _millisecond_, _microsecond_, _nanosecond_). 1. Let _isoDateTime_ be CombineISODateAndTimeRecord(_isoDate_, _time_). 1. Return ? CreateTemporalDateTime(_isoDateTime_, _calendar_, NewTarget). @@ -718,7 +718,7 @@

1. Let _isoDate_ be CreateISODateRecord(ℝ(YearFromTime(_t_)), ℝ(MonthFromTime(_t_)) + 1, ℝ(DateFromTime(_t_))). - 1. Let _time_ be Time Record { [[Days]]: 0, [[Hour]]: ℝ(HourFromTime(_t_)), [[Minute]]: ℝ(MinFromTime(_t_)), [[Second]]: ℝ(SecFromTime(_t_)), [[Millisecond]]: ℝ(msFromTime(_t_)), [[Microsecond]]: 0, [[Nanosecond]]: 0 }. + 1. Let _time_ be CreateTimeRecord(ℝ(HourFromTime(_t_)), ℝ(MinFromTime(_t_)), ℝ(SecFromTime(_t_)), ℝ(msFromTime(_t_)), 0, 0). 1. Return ISO Date-Time Record { [[ISODate]]: _isoDate_, [[Time]]: _time_ }. diff --git a/spec/plaintime.html b/spec/plaintime.html index 02b68f0ac..f685df3f9 100644 --- a/spec/plaintime.html +++ b/spec/plaintime.html @@ -39,7 +39,7 @@

Temporal.PlainTime ( [ _hour_ [ , _minute_ [ , _second_ [ , _millisecond_ [ 1. If _microsecond_ is *undefined*, set _microsecond_ to 0; else set _microsecond_ to ? ToIntegerWithTruncation(_microsecond_). 1. If _nanosecond_ is *undefined*, set _nanosecond_ to 0; else set _nanosecond_ to ? ToIntegerWithTruncation(_nanosecond_). 1. If IsValidTime(_hour_, _minute_, _second_, _millisecond_, _microsecond_, _nanosecond_) is *false*, throw a *RangeError* exception. - 1. Let _time_ be Time Record { [[Hour]]: _hour_, [[Minute]]: _minute_, [[Second]]: _second_, [[Millisecond]]: _millisecond_, [[Microsecond]]: _microsecond_, [[Nanosecond]]: _nanosecond_ }. + 1. Let _time_ be CreateTimeRecord(_hour_, _minute_, _second_, _millisecond_, _microsecond_, _nanosecond_). 1. Return ? CreateTemporalTime(_time_, NewTarget). @@ -445,6 +445,37 @@

Time Records

+ +

+ CreateTimeRecord ( + _hour_: an integer in the inclusive interval from 0 to 23, + _minute_: an integer in the inclusive interval from 0 to 59, + _second_: an integer in the inclusive interval from 0 to 59, + _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, + ): a Time Record +

+
+
description
+
Most uses of Time Records do not require the _deltaDays_ parameter.
+
+ + 1. If _deltaDays_ is not present, set _deltaDays_ to 0. + 1. Assert: IsValidTime(_hour_, _minute_, _second_, _millisecond_, _microsecond_, _nanosecond_). + 1. Return Time Record { + [[Days]]: _deltaDays_, + [[Hour]]: _hour_, + [[Minute]]: _minute_, + [[Second]]: _second_, + [[Millisecond]]: _millisecond_, + [[Microsecond]]: _microsecond_, + [[Nanosecond]]: _nanosecond_ + }. + +
+

MidnightTimeRecord ( ): a Time Record

@@ -592,15 +623,7 @@

1. Else, 1. Assert: _overflow_ is ~reject~. 1. If IsValidTime(_hour_, _minute_, _second_, _millisecond_, _microsecond_, _nanosecond_) is *false*, throw a *RangeError* exception. - 1. Return Time Record { - [[Days]]: 0, - [[Hour]]: _hour_, - [[Minute]]: _minute_, - [[Second]]: _second_, - [[Millisecond]]: _millisecond_, - [[Microsecond]]: _microsecond_, - [[Nanosecond]]: _nanosecond_ - }. + 1. Return CreateTimeRecord(_hour_, _minute_, _second_, _millisecond_, _microsecond_,_nanosecond_). @@ -665,17 +688,9 @@

1. Set _second_ to _second_ modulo 60. 1. Set _hour_ to _hour_ + floor(_minute_ / 60). 1. Set _minute_ to _minute_ modulo 60. - 1. Let _days_ be floor(_hour_ / 24). + 1. Let _deltaDays_ be floor(_hour_ / 24). 1. Set _hour_ to _hour_ modulo 24. - 1. Return Time Record { - [[Days]]: _days_, - [[Hour]]: _hour_, - [[Minute]]: _minute_, - [[Second]]: _second_, - [[Millisecond]]: _millisecond_, - [[Microsecond]]: _microsecond_, - [[Nanosecond]]: _nanosecond_ - }. + 1. Return CreateTimeRecord(_hour_, _minute_, _second_, _millisecond_, _microsecond_, _nanosecond_, _deltaDays_). @@ -701,15 +716,7 @@

1. Set _millisecond_ to the result of clamping _millisecond_ between 0 and 999. 1. Set _microsecond_ to the result of clamping _microsecond_ between 0 and 999. 1. Set _nanosecond_ to the result of clamping _nanosecond_ between 0 and 999. - 1. Return Time Record { - [[Days]]: 0, - [[Hour]]: _hour_, - [[Minute]]: _minute_, - [[Second]]: _second_, - [[Millisecond]]: _millisecond_, - [[Microsecond]]: _microsecond_, - [[Nanosecond]]: _nanosecond_ - }. + 1. Return CreateTimeRecord(_hour_, _minute_, _second_, _millisecond_, _microsecond_, _nanosecond_). @@ -911,15 +918,7 @@

1. Let _unitLength_ be the value in the "Length in Nanoseconds" column of the row of whose "Value" column contains _unit_. 1. Let _result_ be RoundNumberToIncrement(_quantity_, _increment_ × _unitLength_, _roundingMode_) / _unitLength_. 1. If _unit_ is ~day~, then - 1. Return Time Record { - [[Days]]: _result_, - [[Hour]]: 0, - [[Minute]]: 0, - [[Second]]: 0, - [[Millisecond]]: 0, - [[Microsecond]]: 0, - [[Nanosecond]]: 0 - }. + 1. Return CreateTimeRecord(0, 0, 0, 0, 0, 0, _result_). 1. If _unit_ is ~hour~, then 1. Return BalanceTime(_result_, 0, 0, 0, 0, 0). 1. If _unit_ is ~minute~, then diff --git a/spec/timezone.html b/spec/timezone.html index d1f5529a4..ce24655bd 100644 --- a/spec/timezone.html +++ b/spec/timezone.html @@ -73,14 +73,7 @@

1. Assert: _microsecond_ < 1000. 1. Let _nanosecond_ be _remainderNs_ modulo 1000. 1. Let _isoDate_ be CreateISODateRecord(_year_, _month_, _day_). - 1. Let _time_ be Time Record { - [[Hour]]: _hour_, - [[Minute]]: _minute_, - [[Second]]: _second_, - [[Millisecond]]: _millisecond_, - [[Microsecond]]: _microsecond_, - [[Nanosecond]]: _nanosecond_ - }. + 1. Let _time_ be CreateTimeRecord(_hour_, _minute_, _second_, _millisecond_, _microsecond_, _nanosecond_). 1. Return CombineISODateAndTimeRecord(_isoDate_, _time_).