-
Notifications
You must be signed in to change notification settings - Fork 37
Open
Description
When converting dates before 1582 to other Gregorian-derived calendars such as buddhist and japanese, the result is incorrect.
Temporal.PlainDate.from({year: 1582, month: 1, day: 1}).withCalendar('buddhist').month
// => 12 (incorrect)As discussed in tc39/ecma402#1003, all of these calendars should be defined as proleptic - meaning they extend before the Gregorian Calendar was invented in 1582. Therefore, only the year should be changed - the month and day should return 1 in this example.
This is related to browser issues across all JS engines in Intl.DateTimeFormat. Firefox has changed their behavior in 139 beta to match their native Temporal implementation which now returns the correct result.
Temporal.PlainDate.from({year: 1582, month: 1, day: 1}).withCalendar('buddhist').month
// => 1 (correct)Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels