diff --git a/changelog/55_UNRELEASED_2019-xx-xx.md b/changelog/55_UNRELEASED_2019-xx-xx.md index 7904e63a..7c759c30 100644 --- a/changelog/55_UNRELEASED_2019-xx-xx.md +++ b/changelog/55_UNRELEASED_2019-xx-xx.md @@ -31,6 +31,7 @@ - It's now possible to products directly (also in the dropdown of the add button in the header of each day column, maybe useful in combination with the new "Self produced products" feature) - Added that the calories per serving are now also shown - Added that the total costs and calories per day are displayed in the header of each day column +- Added new `config.php` setting `MEAL_PLAN_FIRST_DAY_OF_WEEK` which can be used to start the meal plan on a different day (defaults to `CALENDAR_FIRST_DAY_OF_WEEK`, so no changed behavior when not configured) - Fixed that when `FEATURE_FLAG_STOCK_PRICE_TRACKING` was set to `false`, prices were still shown (thanks @kriddles) - Fixed that the week costs were missing for the weeks 1 - 9 of a year diff --git a/config-dist.php b/config-dist.php index bf2ca90a..4884ff7c 100644 --- a/config-dist.php +++ b/config-dist.php @@ -33,7 +33,7 @@ Setting('CALENDAR_SHOW_WEEK_OF_YEAR', true); # To keep it simple: grocy does not handle any currency conversions, # this here is used to format all money values, -# so doesn't matter really matter, but should be the +# so doesn't really matter, but should be the # ISO 4217 code of the currency ("USD", "EUR", "GBP", etc.) Setting('CURRENCY', 'USD'); @@ -62,6 +62,11 @@ Setting('DISABLE_AUTH', false); # Set this to true if you want to disable the ability to scan a barcode via the device camera (Browser API) Setting('DISABLE_BROWSER_BARCODE_CAMERA_SCANNING', false); +# Set this if you want to have a different start day for the weekly meal plan view, +# leave empty to use CALENDAR_FIRST_DAY_OF_WEEK (see above) +# Needs to be a number where Sunday = 0, Monday = 1 and so forth +Setting('MEAL_PLAN_FIRST_DAY_OF_WEEK', ''); + # Default user settings # These settings can be changed per user, here the defaults diff --git a/public/viewjs/mealplan.js b/public/viewjs/mealplan.js index 4d465037..18785fa9 100644 --- a/public/viewjs/mealplan.js +++ b/public/viewjs/mealplan.js @@ -5,6 +5,10 @@ if (!Grocy.CalendarFirstDayOfWeek.isEmpty()) { firstDay = parseInt(Grocy.CalendarFirstDayOfWeek); } +if (!Grocy.MealPlanFirstDayOfWeek.isEmpty()) +{ + firstDay = parseInt(Grocy.MealPlanFirstDayOfWeek); +} var calendar = $("#calendar").fullCalendar({ "themeSystem": "bootstrap4", diff --git a/views/mealplan.blade.php b/views/mealplan.blade.php index 5eec2e83..cc2385cf 100644 --- a/views/mealplan.blade.php +++ b/views/mealplan.blade.php @@ -21,6 +21,8 @@ Grocy.QuantityUnits = {!! json_encode($quantityUnits) !!}; Grocy.QuantityUnitConversionsResolved = {!! json_encode($quantityUnitConversionsResolved) !!}; + + Grocy.MealPlanFirstDayOfWeek = '{{ GROCY_MEAL_PLAN_FIRST_DAY_OF_WEEK }}';