-
Notifications
You must be signed in to change notification settings - Fork 31
Open
Description
As far as I understand, there is a consensus that Temporal doesn't accept nor do fallback for 'islamic' and 'islamic-rgsa' calendars, as specified in tc39/proposal-intl-era-monthcode#46 . But currently temporal_rs accepts these calendars, and I believe this is spec-incompliant.
temporal/src/builtins/core/calendar.rs
Lines 144 to 159 in d125b62
| let icu_locale_value = Value::try_from_utf8(&bytes.to_ascii_lowercase()) | |
| .map_err(|e| TemporalError::range().with_message(e.to_string()))?; | |
| let algorithm = CalendarAlgorithm::try_from(&icu_locale_value) | |
| .map_err(|e| TemporalError::range().with_message(e.to_string()))?; | |
| let calendar_kind = match AnyCalendarKind::try_from(algorithm) { | |
| Ok(c) => c, | |
| // Handle `islamic` calendar idenitifier. | |
| // | |
| // This should be updated depending on `icu_calendar` support and | |
| // intl-era-monthcode. | |
| Err(()) if algorithm == CalendarAlgorithm::Hijri(None) => { | |
| AnyCalendarKind::HijriTabularTypeIIFriday | |
| } | |
| Err(()) => return Err(TemporalError::range().with_message("unknown calendar")), | |
| }; | |
| Ok(calendar_kind) |
temporal/src/builtins/core/calendar.rs
Lines 106 to 108 in d125b62
| AnyCalendarKind::HijriSimulatedMecca => { | |
| const { &AnyCalendar::HijriSimulated(HijriSimulated::new_mecca()) } | |
| } |
Metadata
Metadata
Assignees
Labels
No labels
Type
Projects
Status
No status