From 61add6b1e8ba58f57e1da1dc349b924b05a80178 Mon Sep 17 00:00:00 2001 From: Kamil Niemczycki Date: Thu, 7 Jul 2022 15:41:21 +0200 Subject: [PATCH] #152 - added local storage --- resources/js/Shared/Widgets/VacationCalendar.vue | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/resources/js/Shared/Widgets/VacationCalendar.vue b/resources/js/Shared/Widgets/VacationCalendar.vue index 4c797b1..6050597 100644 --- a/resources/js/Shared/Widgets/VacationCalendar.vue +++ b/resources/js/Shared/Widgets/VacationCalendar.vue @@ -167,7 +167,7 @@ const selectedYear = useCurrentYearPeriodInfo().year.value const weeksInYear = DateTime.fromObject({ year: selectedYear, month: 12, day: 31 }).weekNumber const calendar = { - viewMode: ref('week'), + viewMode: ref(localStorage.getItem('calendarViewMode') ?? 'week'), currents: reactive({ year: selectedYear, month: selectedYear === currentDate.year ? currentDate.month : 1, @@ -336,6 +336,7 @@ function updateViewMode(type) { else resetCalendar() calendar.viewMode.value = type + localStorage.setItem('calendarViewMode', type) } function isInCurrentMonth(date) {