Skip to content

Commit

Permalink
Bring ResolveISOMonth up to date with the "M"-style month codes
Browse files Browse the repository at this point in the history
This was a spec text bug, left over from when the "M" and the zero-padding
were added.

See: #1424
  • Loading branch information
ptomato committed Apr 16, 2021
1 parent af3bb30 commit dde3968
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions spec/calendar.html
Original file line number Diff line number Diff line change
Expand Up @@ -416,6 +416,17 @@ <h1>ToISOWeekOfYear ( _year_, _month_, _day_ )</h1>
<emu-note>Beware that dates at the beginning of a year may be part of a week from the preceding year, and dates at the end of a year may be part of a week at the beginning of the next year, as the first week of any year is defined as the week that contains the first Thursday of the year.</emu-note>
</emu-clause>

<emu-clause id="sec-buildisomonthcode" aoid="BuildISOMonthCode">
<h1>BuildISOMonthCode ( _month_ )</h1>
<p>
The abstract operation BuildISOMonthCode returns the corresponding string month code, given the numeric ISO calendar month _month_.
</p>
<emu-alg>
1. Let _numberPart_ be the String representation of _month_, formatted as a two-digit decimal number, padded to the left with the code unit 0x0030 (DIGIT ZERO) if necessary.
1. Return the string-concatenation of *"M"* and _numberPart_.
</emu-alg>
</emu-clause>

<emu-clause id="sec-temporal-resolveisomonth" aoid="ResolveISOMonth">
<h1>ResolveISOMonth ( _fields_ )</h1>
<p>
Expand All @@ -436,7 +447,7 @@ <h1>ResolveISOMonth ( _fields_ )</h1>
1. If _numberPart_ is *NaN*, throw a *RangeError* exception.
1. If _month_ is not *undefined*, and _month__numberPart_, then
1. Throw a *RangeError* exception.
1. If ! SameValueNonNumeric(_monthCode_, ! ToString(_numberPart_)) is *false*, then
1. If ! SameValueNonNumeric(_monthCode_, ! BuildISOMonthCode(_numberPart_)) is *false*, then
1. Throw a *RangeError* exception.
1. Return _numberPart_.
</emu-alg>
Expand Down Expand Up @@ -541,8 +552,7 @@ <h1>ISOMonthCode ( _temporalObject_ )</h1>
</p>
<emu-alg>
1. Assert: _temporalObject_ has an [[ISOMonth]] internal slot.
1. Let _monthCode_ be the String representation of _temporalObject_.[[ISOMonth]], formatted as a two-digit decimal number, padded to the left with the code unit 0x0030 (DIGIT ZERO) if necessary.
1. Return the string-concatenation of *"M"* and _monthCode_.
1. Return ! BuildISOMonthCode(_temporalObject_.[[ISOMonth]]).
</emu-alg>
</emu-clause>

Expand Down

0 comments on commit dde3968

Please sign in to comment.