Skip to content

Commit c75c841

Browse files
committed
Editorial: Clarify requirement for implementation-defined month-day validation
Closes: #3002
1 parent 68fe496 commit c75c841

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

spec/calendar.html

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -877,6 +877,11 @@ <h1>
877877
Also like RegulateISODate, if _overflow_ is ~constrain~ and the date or month and day described by _fields_ does not exist (or does not exist within the year described by _fields_ when there is such a year), the values of those fields are clamped to their respective valid range. As in CalendarDateToISO, such clamping is calendar-specific.
878878
For example, when _calendar_ is *"gregory"* and _overflow_ is ~constrain~, a _fields_ value of { [[MonthCode]]: *"M02"*, [[Day]]: 30 } is clamped to { [[Year]]: 1972, [[Month]]: 2, [[Day]]: 29 } (because 29 is the maximum valid day for February) while _fields_ values of { [[Year]]: 2001, [[MonthCode]]: *"M02"*, [[Day]]: 30 } and { [[Era]]: *"ce"*, [[EraYear]]: 2001, [[Month]]: 2, [[Day]]: 30 } (or an equivalent with a supported value for [[Era]] representing the Common Era beginning in ISO 8601 year 1) are clamped to { [[Year]]: 1972, [[Month]]: 2, [[Day]]: 28 } (because 28 is the maximum valid day for February 2001, which did not include a leap day).
879879
</p>
880+
<p>
881+
The operation throws a *RangeError* if _fields_.[[Year]] is not ~unset~ and the ISO 8601 year _year_ corresponding to _fields_.[[Year]] would cause ISODateWithinLimits to return *false* (i.e., _year_ is not in the inclusive interval from -271,821 to 275,760.)
882+
This is so as not to require calculating whether the month and day described in _fields_ exist in years arbitrarily far in the future or past.
883+
Note this restriction does not apply when _calendar_ is *"iso8601"*.
884+
</p>
880885
</emu-clause>
881886

882887
<emu-clause id="sec-temporal-calendarisotodate" type="implementation-defined abstract operation">

0 commit comments

Comments
 (0)