diff --git a/changelog/50_2.4.3_2019-xx-xx.md b/changelog/50_2.4.3_2019-xx-xx.md index 63b8bf3f..9a3a938d 100644 --- a/changelog/50_2.4.3_2019-xx-xx.md +++ b/changelog/50_2.4.3_2019-xx-xx.md @@ -11,4 +11,5 @@ - Items can now be marked as "done" (new check mark button per item, when clicked, the item will be displayed greyed out, when clicked again the item will be displayed normally again) - Improved that products can now also be consumed as spoiled from the stock overview page (option in the more/context menu per line) - Added a "consume this recipe"-button to the meal plan (and also a button to consume all recipes for a whole week) -- Added a new `config.php` setting `DISABLE_AUTH` to be able to disable authentication / the login screen +- Added a new `config.php` setting `DISABLE_AUTH` to be able to disable authentication / the login screen, defaults to `false` +- Added a new `config.php` setting `CALENDAR_FIRST_DAY_OF_WEEK` to be able to change the first day of a week used for calendar views (meal plan for example) in the frontend, defaults to locale default diff --git a/config-dist.php b/config-dist.php index 029da686..65423f78 100644 --- a/config-dist.php +++ b/config-dist.php @@ -21,6 +21,11 @@ Setting('MODE', 'production'); # one of the other available localization files in the "/localization" directory Setting('CULTURE', 'en'); +# This is used to define the first day of a week for calendar views in the frontend, +# leave empty to use the locale default +# Needs to be a number where Sunday = 0, Monday = 1 and so forth +Setting('CALENDAR_FIRST_DAY_OF_WEEK', ''); + # 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 diff --git a/public/viewjs/calendar.js b/public/viewjs/calendar.js index c6e27c3b..0745bdf5 100644 --- a/public/viewjs/calendar.js +++ b/public/viewjs/calendar.js @@ -1,4 +1,10 @@ -$("#calendar").fullCalendar({ +var firstDay = null; +if (!Grocy.CalendarFirstDayOfWeek.isEmpty()) +{ + firstDay = parseInt(Grocy.CalendarFirstDayOfWeek); +} + +$("#calendar").fullCalendar({ "themeSystem": "bootstrap4", "header": { "left": "month,basicWeek,listWeek", @@ -6,6 +12,7 @@ "right": "prev,next" }, "weekNumbers": true, + "firstDay": firstDay, "eventLimit": true, "eventSources": fullcalendarEventSources }); diff --git a/public/viewjs/mealplan.js b/public/viewjs/mealplan.js index 9a35d182..33d30478 100644 --- a/public/viewjs/mealplan.js +++ b/public/viewjs/mealplan.js @@ -1,5 +1,11 @@ var firstRender = true; +var firstDay = null; +if (!Grocy.CalendarFirstDayOfWeek.isEmpty()) +{ + firstDay = parseInt(Grocy.CalendarFirstDayOfWeek); +} + var calendar = $("#calendar").fullCalendar({ "themeSystem": "bootstrap4", "header": { @@ -11,6 +17,7 @@ var calendar = $("#calendar").fullCalendar({ "eventLimit": true, "eventSources": fullcalendarEventSources, "defaultView": "basicWeek", + "firstDay": firstDay, "viewRender": function(view) { if (firstRender) diff --git a/views/layout/default.blade.php b/views/layout/default.blade.php index 95a6f2d1..d7d94a97 100644 --- a/views/layout/default.blade.php +++ b/views/layout/default.blade.php @@ -52,6 +52,7 @@ Grocy.ActiveNav = '@yield('activeNav', '')'; Grocy.Culture = '{{ GROCY_CULTURE }}'; Grocy.Currency = '{{ GROCY_CURRENCY }}'; + Grocy.CalendarFirstDayOfWeek = '{{ GROCY_CALENDAR_FIRST_DAY_OF_WEEK }}'; Grocy.GettextPo = {!! $GettextPo !!}; Grocy.UserSettings = {!! json_encode($userSettings) !!}; Grocy.FeatureFlags = {!! json_encode($featureFlags) !!};