diff --git a/src/components/date/datepickerWithRange.vue b/src/components/date/datepickerWithRange.vue
index 8b4b41cea..4438f84db 100644
--- a/src/components/date/datepickerWithRange.vue
+++ b/src/components/date/datepickerWithRange.vue
@@ -2,8 +2,8 @@
-
- {{ $t('task.show.select') }}
+
+ {{ buttonText }}
@@ -185,6 +185,13 @@ const {t} = useI18n()
const emit = defineEmits(['dateChanged'])
+const props = defineProps({
+ showSelectedOnButton: {
+ type: Boolean,
+ default: false,
+ }
+})
+
// 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(() => ({
@@ -257,6 +264,17 @@ function setDateRange(range: string[] | null) {
const customRangeActive = computed(() => {
return !Object.values(dateRanges).some(el => from.value === el[0] && to.value === el[1])
})
+
+const buttonText = computed(() => {
+ if(props.showSelectedOnButton && from.value !== '' && to.value !== '') {
+ return t('input.datepickerRange.fromto', {
+ from: from.value,
+ to: to.value,
+ })
+ }
+
+ return t('task.show.select')
+})