Simplified initial /mealplan start date handling (fixes #2286)

This commit is contained in:
Bernd Bestel 2023-07-31 21:29:28 +02:00
parent e946ec79d5
commit 8b444a03e5
No known key found for this signature in database
GPG Key ID: 71BD34C0D4891300
2 changed files with 3 additions and 15 deletions

View File

@ -21,7 +21,7 @@
### Meal plan ### Meal plan
- xxx - Fixed that the meal plan did initially not display the current week when the settings `MEAL_PLAN_FIRST_DAY_OF_WEEK` and `CALENDAR_FIRST_DAY_OF_WEEK` were set to different values
### Chores ### Chores

View File

@ -668,8 +668,8 @@ $(document).on("click", ".easy-link-copy-textbox", function()
if (Grocy.CalendarFirstDayOfWeek) if (Grocy.CalendarFirstDayOfWeek)
{ {
moment.updateLocale(moment.locale(), { moment.updateLocale(moment.locale(), {
week: { "week": {
dow: Number.parseInt(Grocy.CalendarFirstDayOfWeek) "dow": Number.parseInt(Grocy.CalendarFirstDayOfWeek)
} }
}); });
} }
@ -772,18 +772,6 @@ $(window).on("message", function(e)
} }
}); });
if (Grocy.FeatureFlags.GROCY_FEATURE_FLAG_RECIPES)
{
if ($(window).width() < 768)
{
$("#meal-plan-nav-link").attr("href", $("#meal-plan-nav-link").attr("href") + "?start=" + moment().format("YYYY-MM-DD") + "&days=0");
}
else
{
$("#meal-plan-nav-link").attr("href", $("#meal-plan-nav-link").attr("href") + "?start=" + moment().startOf("week").format("YYYY-MM-DD"));
}
}
$('[data-toggle="tooltip"][data-html="true"]').on("shown.bs.tooltip", function() $('[data-toggle="tooltip"][data-html="true"]').on("shown.bs.tooltip", function()
{ {
RefreshLocaleNumberDisplay(".tooltip"); RefreshLocaleNumberDisplay(".tooltip");