@@ -530,8 +530,7 @@ Handle<Object> JSDateTimeFormat::TimeZoneId(Isolate* isolate,
530530
531531namespace {
532532Handle<String> GetCalendar (Isolate* isolate,
533- const icu::SimpleDateFormat& simple_date_format,
534- bool is_alt_calendar = false ) {
533+ const icu::SimpleDateFormat& simple_date_format) {
535534 // getType() returns legacy calendar type name instead of LDML/BCP47 calendar
536535 // key values. intl.js maps them to BCP47 values for key "ca".
537536 // TODO(jshin): Consider doing it here, instead.
@@ -542,17 +541,9 @@ Handle<String> GetCalendar(Isolate* isolate,
542541 // and
543542 // http://www.unicode.org/repos/cldr/tags/latest/common/bcp47/calendar.xml
544543 if (calendar_str == " gregorian" ) {
545- if (is_alt_calendar) {
546- calendar_str = " iso8601" ;
547- } else {
548- calendar_str = " gregory" ;
549- }
544+ calendar_str = " gregory" ;
550545 } else if (calendar_str == " ethiopic-amete-alem" ) {
551546 calendar_str = " ethioaa" ;
552- } else if (calendar_str == " islamic" ) {
553- if (is_alt_calendar) {
554- calendar_str = " islamic-rgsa" ;
555- }
556547 }
557548 return isolate->factory ()->NewStringFromAsciiChecked (calendar_str.c_str ());
558549}
@@ -567,8 +558,7 @@ Handle<Object> GetTimeZone(Isolate* isolate,
567558Handle<String> JSDateTimeFormat::Calendar (
568559 Isolate* isolate, Handle<JSDateTimeFormat> date_time_format) {
569560 return GetCalendar (isolate,
570- *(date_time_format->icu_simple_date_format ().raw ()),
571- date_time_format->alt_calendar ());
561+ *(date_time_format->icu_simple_date_format ().raw ()));
572562}
573563
574564Handle<Object> JSDateTimeFormat::TimeZone (
@@ -2328,9 +2318,6 @@ MaybeHandle<JSDateTimeFormat> JSDateTimeFormat::New(
23282318 icu_locale.setUnicodeKeywordValue (" ca" , calendar_str.get (), status);
23292319 DCHECK (U_SUCCESS (status));
23302320 }
2331- bool alt_calendar =
2332- strstr (icu_locale.getName (), " calendar=iso8601" ) != nullptr ||
2333- strstr (icu_locale.getName (), " calendar=islamic-rgsa" ) != nullptr ;
23342321
23352322 if (numbering_system_str != nullptr &&
23362323 Intl::IsValidNumberingSystem (numbering_system_str.get ())) {
@@ -2640,7 +2627,6 @@ MaybeHandle<JSDateTimeFormat> JSDateTimeFormat::New(
26402627 date_time_format->set_time_style (time_style);
26412628 }
26422629 date_time_format->set_hour_cycle (dateTimeFormatHourCycle);
2643- date_time_format->set_alt_calendar (alt_calendar);
26442630 date_time_format->set_locale (*locale_str);
26452631 date_time_format->set_icu_locale (*managed_locale);
26462632 date_time_format->set_icu_simple_date_format (*managed_format);
@@ -2742,10 +2728,8 @@ MaybeHandle<JSArray> FormatToPartsWithTemporalSupport(
27422728 DateTimeValueRecord x_record;
27432729 MAYBE_ASSIGN_RETURN_ON_EXCEPTION_VALUE (
27442730 isolate, x_record,
2745- HandleDateTimeValue (
2746- isolate, *format,
2747- GetCalendar (isolate, *format, date_time_format->alt_calendar ()), x,
2748- method_name),
2731+ HandleDateTimeValue (isolate, *format, GetCalendar (isolate, *format), x,
2732+ method_name),
27492733 Handle<JSArray>());
27502734
27512735 return FormatMillisecondsByKindToArray (isolate, *format, x_record.kind ,
@@ -3070,8 +3054,8 @@ MaybeHandle<T> FormatRangeCommonWithTemporalSupport(
30703054 // 6. Let x be ? HandleDateTimeValue(dateTimeFormat, x).
30713055 icu::SimpleDateFormat* icu_simple_date_format =
30723056 date_time_format->icu_simple_date_format ().raw ();
3073- Handle<String> date_time_format_calendar = GetCalendar (
3074- isolate, *icu_simple_date_format, date_time_format-> alt_calendar () );
3057+ Handle<String> date_time_format_calendar =
3058+ GetCalendar ( isolate, *icu_simple_date_format);
30753059 DateTimeValueRecord x_record;
30763060 MAYBE_ASSIGN_RETURN_ON_EXCEPTION_VALUE (
30773061 isolate, x_record,
0 commit comments