Skip to content

Commit

Permalink
Add options parameter to Date.to_locale_time_string
Browse files Browse the repository at this point in the history
  • Loading branch information
paul-hansen committed Dec 27, 2024
1 parent 24f20ae commit df956a0
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion crates/js-sys/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion crates/js-sys/tests/wasm/Date.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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",
);
}
Expand Down

0 comments on commit df956a0

Please sign in to comment.