diff --git a/web/typo3conf/ext/ep_theme/Resources/Private/Assets/js/components/DaterangeSelect.vue b/web/typo3conf/ext/ep_theme/Resources/Private/Assets/js/components/DaterangeSelect.vue index b45fe88e..a3a7f77c 100644 --- a/web/typo3conf/ext/ep_theme/Resources/Private/Assets/js/components/DaterangeSelect.vue +++ b/web/typo3conf/ext/ep_theme/Resources/Private/Assets/js/components/DaterangeSelect.vue @@ -21,8 +21,13 @@ -
  • - schließen +
  • + +
  • @@ -37,6 +42,7 @@ import 'dayjs/locale/de' import flatpickr from 'flatpickr' import { German } from 'flatpickr/dist/l10n/de' + import EventBus from '../_bus' export default { data () { @@ -95,19 +101,16 @@ if (this.from && this.to) { this.picker.setDate([ new Date(this.from), new Date(this.to) ]); } - }) + }); + EventBus.$on('filterSettingsReset', () => { + this.reset(); + }); }, computed: { selectedRange () { if (this.selectedFrom == null && this.selectedTo == null) { return ''; } - if (this.selectedFrom !== null && this.selectedTo === null) { - return 'ab ' + dayjs(this.selectedFrom).format('DD.MM.YYYY'); - } - if (this.selectedFrom === null && this.selectedTo !== null) { - return 'bis ' + dayjs(this.selectedTo).format('DD.MM.YYYY'); - } return dayjs(this.selectedFrom).format('DD.MM.YYYY') + '-' + dayjs(this.selectedTo).format('DD.MM.YYYY'); } @@ -122,6 +125,14 @@ this.picker.setDate([ this.selectedFrom, this.selectedTo ]); this.togglePanel(); this.$emit('selected', { from: this.selectedFrom, to: this.selectedTo }); + }, + reset () { + this.selectedFrom = null; + this.selectedTo = null; + this.picker.clear(); + this.picker.jumpToDate(); + this.togglePanel(); + this.$emit('selected', { from: this.selectedFrom, to: this.selectedTo }); } } } diff --git a/web/typo3conf/ext/ep_theme/Resources/Private/Assets/js/components/SearchResult.vue b/web/typo3conf/ext/ep_theme/Resources/Private/Assets/js/components/SearchResult.vue index 73c6a992..32c8d064 100644 --- a/web/typo3conf/ext/ep_theme/Resources/Private/Assets/js/components/SearchResult.vue +++ b/web/typo3conf/ext/ep_theme/Resources/Private/Assets/js/components/SearchResult.vue @@ -142,6 +142,7 @@ }, resetFilterSettings () { this.filterSettings = this.defaultFilterSettings; + EventBus.$emit('filterSettingsReset'); this.loadResults(); }, updateDestination (destination) { diff --git a/web/typo3conf/ext/ep_theme/Resources/Private/Assets/scss/remix/_datepicker.scss b/web/typo3conf/ext/ep_theme/Resources/Private/Assets/scss/remix/_datepicker.scss index 7ecc5855..f269c970 100644 --- a/web/typo3conf/ext/ep_theme/Resources/Private/Assets/scss/remix/_datepicker.scss +++ b/web/typo3conf/ext/ep_theme/Resources/Private/Assets/scss/remix/_datepicker.scss @@ -22,11 +22,17 @@ color: $color-font-base; } +.daterange__buttons { + display: flex; + justify-content: space-between; +} + .daterange__button { color: $color-font-base; border: none; background: none; outline: none; + width: percentage(1/2); } .flatpickr-input {