feat: add date math for filters #1342

Merged
konrad merged 88 commits from feature/date-math into main 2022-03-28 17:30:43 +00:00
1 changed files with 5 additions and 5 deletions
Showing only changes of commit c24b8af00d - Show all commits

View File

@ -47,7 +47,8 @@ const {t} = useI18n()
const emit = defineEmits(['dateChanged'])
const weekStart = computed<number>(() => store.state.auth.settings.weekStart)
// FIXME: This seems to always contain the default value - that breaks the picker
const weekStart = computed<number>(() => 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<string>('')
@ -110,7 +110,7 @@ const datesToday = computed<string>(() => {
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))))