-
Notifications
You must be signed in to change notification settings - Fork 37
Open
Description
According to the Temporal specification (CalendarMonthDayToISOReferenceDate), ISO-calendar PlainMonthDays should only use the year field to determine if the month and day exist, not to check the range.
I think this is probably due to the use of self.date_from_fields() to carry out the RegulateISODate step in the spec, which does not check the year range. So it appears to be a regression from #492.
This JS snippet throws in Boa and V8, but should not:
new Temporal.PlainMonthDay(1, 1).with({ year: -271821 })temporal_rs reproducers:
let iso = IsoDate::new_unchecked(1972, 1, 1);
let md = PlainMonthDay::new_unchecked(iso, Calendar::ISO);
let partial = CalendarFields {
year: Some(-271821),
..Default::default()
};
let result = md.with(partial, None).expect("should not throw");
let fields = CalendarFields {
year: Some(-271821),
month: Some(1),
day: Some(1),
..Default::default()
};
Calendar::ISO.month_day_from_fields(fields, Overflow::Constrain).expect("should not throw");Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels
Type
Projects
Status
No status