diff --git a/crates/js-sys/CHANGELOG.md b/crates/js-sys/CHANGELOG.md index 5a4de395eeb..c93b5c76b4b 100644 --- a/crates/js-sys/CHANGELOG.md +++ b/crates/js-sys/CHANGELOG.md @@ -1,6 +1,12 @@ # `js-sys` Change Log -------------------------------------------------------------------------------- +## Unreleased + +### Changed + +* Added `options` parameter to `Date.to_local_time_string` + [#4384](https://github.com/rustwasm/wasm-bindgen/pull/4384) ## 0.2.1 diff --git a/crates/js-sys/src/lib.rs b/crates/js-sys/src/lib.rs index 459e4d93953..d0ead3a4cb5 100644 --- a/crates/js-sys/src/lib.rs +++ b/crates/js-sys/src/lib.rs @@ -3390,7 +3390,7 @@ extern "C" { /// /// [MDN documentation](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toLocaleTimeString) #[wasm_bindgen(method, js_name = toLocaleTimeString)] - pub fn to_locale_time_string(this: &Date, locale: &str) -> JsString; + pub fn to_locale_time_string(this: &Date, locale: &str, options: &JsValue) -> JsString; /// The `toString()` method returns a string representing /// the specified Date object. diff --git a/crates/js-sys/tests/wasm/Date.rs b/crates/js-sys/tests/wasm/Date.rs index 484498d4739..0a224093e56 100644 --- a/crates/js-sys/tests/wasm/Date.rs +++ b/crates/js-sys/tests/wasm/Date.rs @@ -484,7 +484,7 @@ fn to_locale_string() { fn to_locale_time_string() { let date = Date::new(&"August 19, 1975 23:15:30".into()); assert_eq!( - JsValue::from(date.to_locale_time_string("en-US")), + JsValue::from(date.to_locale_time_string("en-US", &JsValue::undefined())), "11:15:30 PM", ); }