diff --git a/ecmascript/js_date_time_format.cpp b/ecmascript/js_date_time_format.cpp index 28dc11ef4a47f885bb2afff1260012706bfa337e..15a861bdcfea43d03ebd96c6db8cc20e41205f6a 100644 --- a/ecmascript/js_date_time_format.cpp +++ b/ecmascript/js_date_time_format.cpp @@ -414,6 +414,12 @@ JSHandle JSDateTimeFormat::InitializeDateTimeFormat(JSThread * ASSERT_PRINT(!icuLocale.isBogus(), "icuLocale is bogus"); UErrorCode status = U_ZERO_ERROR; + if (numberingSystem->IsUndefined()) { + std::string numberingSystemStr = JSLocale::GetNumberingSystem(icuLocale); + auto result = factory->NewFromStdString(numberingSystemStr); + dateTimeFormat->SetNumberingSystem(thread, result); + } + // Set resolvedIcuLocaleCopy to a copy of icuLocale. // Set icuLocale.[[ca]] to calendar. // Set icuLocale.[[nu]] to numberingSystem. @@ -1010,6 +1016,8 @@ void JSDateTimeFormat::ResolvedOptions(JSThread *thread, const JSHandleGetHandledEthioaaString().GetTaggedValue()); + } else if (icuCalendar.length() != 0) { + calendarValue.Update(factory->NewFromStdString(icuCalendar).GetTaggedValue()); } property = globalConst->GetHandledCalendarString(); JSObject::CreateDataPropertyOrThrow(thread, options, property, calendarValue);