The proposal is that the withCalendar() methods of PlainDate, PlainDateTime, and ZonedDateTime should allow omitting the argument, or undefined, to mean the ISO calendar.
Advantages:
The ISO calendar acts like a default calendar elsewhere in Temporal, except where a calendar is explicitly needed from the programmer. But if you have a maybe-non-ISO date and want to convert it to ISO (which will be a very common operation when accepting external data), the developer needs to spell out 'iso8601' in every call site. This seems unnecessary, since it's not a call site where omitting the calendar might lead to unexpected results when encountering non-ISO calendars.
Previously proposed at https://github.com/tc39/proposal-temporal/issues/1324.
The proposal is that the
withCalendar()
methods of PlainDate, PlainDateTime, and ZonedDateTime should allow omitting the argument, orundefined
, to mean the ISO calendar.Advantages:
The ISO calendar acts like a default calendar elsewhere in Temporal, except where a calendar is explicitly needed from the programmer. But if you have a maybe-non-ISO date and want to convert it to ISO (which will be a very common operation when accepting external data), the developer needs to spell out 'iso8601' in every call site. This seems unnecessary, since it's not a call site where omitting the calendar might lead to unexpected results when encountering non-ISO calendars.
Concerns:
TBD
Prior art:
TBD
Constraints / corner cases:
TBD