Toast message when scheduling a recipe
This commit is contained in:
parent
fbef990022
commit
ccb1248da3
11 changed files with 168 additions and 66 deletions
|
|
@ -1,3 +1,6 @@
|
|||
use std::str::FromStr;
|
||||
|
||||
use chrono::Locale;
|
||||
use gloo::utils::document;
|
||||
use wasm_bindgen::prelude::*;
|
||||
use web_sys::Element;
|
||||
|
|
@ -86,3 +89,11 @@ where
|
|||
.dyn_into::<T>()
|
||||
.unwrap()
|
||||
}
|
||||
|
||||
pub fn get_locale() -> Locale {
|
||||
let lang_and_territory = selector::<Element>("html")
|
||||
.get_attribute("lang")
|
||||
.unwrap()
|
||||
.replace("-", "_");
|
||||
Locale::from_str(&lang_and_territory).unwrap_or_default()
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue