Add first day of the week feature to user settings and calendar functionality

This commit is contained in:
Greg Burri 2025-04-19 12:01:46 +02:00
parent 39f5b968b4
commit fdbf2e4f27
15 changed files with 191 additions and 42 deletions

View file

@ -1,7 +1,8 @@
use chrono::Weekday;
use common::utils::substitute_with_names;
use gloo::events::EventListener;
use wasm_bindgen_futures::spawn_local;
use web_sys::{Element, HtmlInputElement};
use web_sys::{Element, HtmlElement, HtmlInputElement};
use crate::{
calendar, modal_dialog,
@ -10,7 +11,7 @@ use crate::{
utils::{SelectorExt, get_locale, selector},
};
pub fn setup_page(recipe_id: i64, is_user_logged: bool) {
pub fn setup_page(recipe_id: i64, is_user_logged: bool, first_day_of_the_week: Weekday) {
let recipe_scheduler = RecipeScheduler::new(!is_user_logged);
let add_to_planner: Element = selector("#recipe-view .add-to-planner");
@ -26,6 +27,7 @@ pub fn setup_page(recipe_id: i64, is_user_logged: bool) {
calendar::CalendarOptions {
can_select_date: true,
with_link_and_remove: false,
first_day_of_the_week,
},
recipe_scheduler,
)