Toast message when scheduling a recipe

This commit is contained in:
Greg Burri 2025-02-05 15:44:48 +01:00
parent fbef990022
commit ccb1248da3
11 changed files with 168 additions and 66 deletions

View file

@ -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()
}