Skip to content

Expose non-ISO equivalent of RegulateISODate / NonISOCalendarDateToISO #6790

@Manishearth

Description

@Manishearth

@sffc is working on this on the standards side

We have https://tc39.es/proposal-temporal/#sec-temporal-regulateisodate, which gets called by Temporal in code like this:

// Construct 01-01, Śaka 1927
var nonLeapYearFirstDay = Temporal.PlainDate.from("2005-03-22[u-ca=indian]");
nonLeapYearFirstDay.with({ day: 31 };
console.log(nonLeapYearFirstDay.day) // 30

Temporal throws range errors when constructing out-of-range dates, but .with() is allowed to specify an overflow option.

As such, we need a way to take a set of codes and "constrain" them to that calendar when the overflow option is set.

Metadata

Metadata

Assignees

Labels

C-datetimeComponent: datetime, calendars, time zonesU-temporalUser: Temporal and V8

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions