diff --git a/src/objects/intl-objects.h b/src/objects/intl-objects.h index 3b7e07c63e..0c4a77b745 100644 --- a/src/objects/intl-objects.h +++ b/src/objects/intl-objects.h @@ -240,14 +240,14 @@ class Intl { Handle constructor, bool has_initialized_slot); // enum for "caseFirst" option: shared by Intl.Locale and Intl.Collator. - enum class CaseFirst { kUpper, kLower, kFalse, kUndefined }; + enum class CaseFirst { kUndefined, kUpper, kLower, kFalse }; // Shared function to read the "caseFirst" option. V8_WARN_UNUSED_RESULT static Maybe GetCaseFirst( Isolate* isolate, Handle options, const char* method); // enum for "hourCycle" option: shared by Intl.Locale and Intl.DateTimeFormat. - enum class HourCycle { kH11, kH12, kH23, kH24, kUndefined }; + enum class HourCycle { kUndefined, kH11, kH12, kH23, kH24 }; static HourCycle ToHourCycle(const std::string& str); diff --git a/src/objects/js-date-time-format.cc b/src/objects/js-date-time-format.cc index 07e4c89a97..d30586b428 100644 --- a/src/objects/js-date-time-format.cc +++ b/src/objects/js-date-time-format.cc @@ -1546,12 +1546,16 @@ MaybeHandle JSDateTimeFormat::New( isolate->factory()->NewFastOrSlowJSObjectFromMap(map)); DisallowHeapAllocation no_gc; date_time_format->set_flags(0); - date_time_format->set_hour_cycle(hc); if (date_style != DateTimeStyle::kUndefined) { date_time_format->set_date_style(date_style); } if (time_style != DateTimeStyle::kUndefined) { date_time_format->set_time_style(time_style); + date_time_format->set_hour_cycle(hc); + } + if ((date_style == DateTimeStyle::kUndefined) && + (time_style == DateTimeStyle::kUndefined)) { + date_time_format->set_hour_cycle(hc); } date_time_format->set_icu_locale(*managed_locale); date_time_format->set_icu_simple_date_format(*managed_format); diff --git a/test/intl/date-format/property-override-date-style.js b/test/intl/date-format/property-override-date-style.js index f0a2211d2b..c7965a41c5 100644 --- a/test/intl/date-format/property-override-date-style.js +++ b/test/intl/date-format/property-override-date-style.js @@ -32,8 +32,6 @@ var expectedProperties = [ 'calendar', 'numberingSystem', 'timeZone', - 'hourCycle', - 'hour12', 'dateStyle', ];