Skip to content

Commit 2289a37

Browse files
committed
Fix a spec violation in Date.prototype.toLocaleString
1 parent df1f0ff commit 2289a37

File tree

1 file changed

+0
-18
lines changed
  • core/engine/src/builtins/intl/date_time_format

1 file changed

+0
-18
lines changed

core/engine/src/builtins/intl/date_time_format/mod.rs

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1025,24 +1025,6 @@ pub(crate) fn format_date_time_locale(
10251025
context: &mut Context,
10261026
) -> JsResult<JsValue> {
10271027
let options = coerce_options_to_object(options, context)?;
1028-
if format_type != FormatType::Time
1029-
&& get_option::<DateStyle>(&options, js_string!("dateStyle"), context)?.is_none()
1030-
{
1031-
options.create_data_property_or_throw(
1032-
js_string!("dateStyle"),
1033-
JsValue::from(js_string!("long")),
1034-
context,
1035-
)?;
1036-
}
1037-
if format_type != FormatType::Date
1038-
&& get_option::<TimeStyle>(&options, js_string!("timeStyle"), context)?.is_none()
1039-
{
1040-
options.create_data_property_or_throw(
1041-
js_string!("timeStyle"),
1042-
JsValue::from(js_string!("long")),
1043-
context,
1044-
)?;
1045-
}
10461028
let options_value = options.into();
10471029
let dtf = create_date_time_format(locales, &options_value, format_type, defaults, context)?;
10481030
// FormatDateTime steps 1–2: TimeClip and NaN check (format_timestamp_with_dtf does ToLocalTime + format only).

0 commit comments

Comments
 (0)