diff --git a/src/components/date/datepickerWithRange.vue b/src/components/date/datepickerWithRange.vue index 67aac325..d06cd2e2 100644 --- a/src/components/date/datepickerWithRange.vue +++ b/src/components/date/datepickerWithRange.vue @@ -3,8 +3,8 @@ @@ -187,6 +187,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(() => ({ @@ -259,6 +266,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') +})