From c24b8af00d4fcdb65e1421bce067e229340c5ddb Mon Sep 17 00:00:00 2001 From: kolaente Date: Wed, 29 Dec 2021 16:51:21 +0100 Subject: [PATCH] fix: pay attention to week start setting --- src/components/date/datepickerWithRange.vue | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/components/date/datepickerWithRange.vue b/src/components/date/datepickerWithRange.vue index fb8127330..bdc33e779 100644 --- a/src/components/date/datepickerWithRange.vue +++ b/src/components/date/datepickerWithRange.vue @@ -47,7 +47,8 @@ const {t} = useI18n() const emit = defineEmits(['dateChanged']) -const weekStart = computed(() => store.state.auth.settings.weekStart) +// FIXME: This seems to always contain the default value - that breaks the picker +const weekStart = computed(() => store.state.auth.settings.weekStart ?? 0) const flatPickerConfig = computed(() => ({ altFormat: t('date.altFormatLong'), altInput: true, @@ -55,10 +56,9 @@ const flatPickerConfig = computed(() => ({ enableTime: false, inline: true, mode: 'range', - /*locale: { - // FIXME: This seems to always contain the default value - that breaks the picker + locale: { firstDayOf7Days: weekStart, - },*/ + }, })) const dateRange = ref('') @@ -110,7 +110,7 @@ const datesToday = computed(() => { function thisWeek() { const startDate = startOfDay(new Date()) - const first = startDate.getDate() - startDate.getDay() + const first = startDate.getDate() - startDate.getDay() + weekStart.value startDate.setDate(first) const endDate = endOfDay(new Date((new Date(startDate).setDate(first + 6))))