From 27bb80d11aaa84311c15ed31f7aaa7c02b19af24 Mon Sep 17 00:00:00 2001 From: kolaente Date: Mon, 8 Jun 2026 15:16:16 +0200 Subject: [PATCH] feat(input): add quick-select shortcuts to the Datepicker --- frontend/src/components/input/Datepicker.vue | 11 +- .../src/components/input/DatepickerInline.vue | 133 +++++++++--------- 2 files changed, 79 insertions(+), 65 deletions(-) diff --git a/frontend/src/components/input/Datepicker.vue b/frontend/src/components/input/Datepicker.vue index b3f55888c..2f1de652c 100644 --- a/frontend/src/components/input/Datepicker.vue +++ b/frontend/src/components/input/Datepicker.vue @@ -5,7 +5,10 @@ :disabled="disabled || undefined" @click.stop="toggleDatePopup" > - {{ date === null ? chooseDateLabel : formatDisplayDate(date) }} + {{ emptyLabel }} + @@ -16,6 +19,7 @@ > @@ -48,12 +52,17 @@ const props = withDefaults(defineProps<{ modelValue: Date | null | string, chooseDateLabel?: string, disabled?: boolean, + showShortcuts?: boolean, + // When the value is null, show this (italic) instead of chooseDateLabel. + emptyLabel?: string, }>(), { chooseDateLabel: () => { const {t} = useI18n({useScope: 'global'}) return t('input.datepicker.chooseDate') }, disabled: false, + showShortcuts: true, + emptyLabel: '', }) const emit = defineEmits<{ diff --git a/frontend/src/components/input/DatepickerInline.vue b/frontend/src/components/input/DatepickerInline.vue index 9f0467889..2245b0043 100644 --- a/frontend/src/components/input/DatepickerInline.vue +++ b/frontend/src/components/input/DatepickerInline.vue @@ -1,66 +1,68 @@