fix: reset the flatpickr range when setting a date either manually or through a quick setting
This commit is contained in:
parent
16f48bcc2d
commit
4d23fae9ad
1 changed files with 9 additions and 4 deletions
|
@ -27,7 +27,7 @@
|
||||||
{{ $t('input.datepickerRange.from') }}
|
{{ $t('input.datepickerRange.from') }}
|
||||||
<div class="field has-addons">
|
<div class="field has-addons">
|
||||||
<div class="control is-fullwidth">
|
<div class="control is-fullwidth">
|
||||||
<input class="input" type="text" v-model="from" @change="emitChanged"/>
|
<input class="input" type="text" v-model="from" @change="inputChanged"/>
|
||||||
</div>
|
</div>
|
||||||
<div class="control">
|
<div class="control">
|
||||||
<x-button icon="calendar" variant="secondary" data-toggle/>
|
<x-button icon="calendar" variant="secondary" data-toggle/>
|
||||||
|
@ -38,7 +38,7 @@
|
||||||
{{ $t('input.datepickerRange.to') }}
|
{{ $t('input.datepickerRange.to') }}
|
||||||
<div class="field has-addons">
|
<div class="field has-addons">
|
||||||
<div class="control is-fullwidth">
|
<div class="control is-fullwidth">
|
||||||
<input class="input" type="text" v-model="to" @change="emitChanged"/>
|
<input class="input" type="text" v-model="to" @change="inputChanged"/>
|
||||||
</div>
|
</div>
|
||||||
<div class="control">
|
<div class="control">
|
||||||
<x-button icon="calendar" variant="secondary" data-toggle/>
|
<x-button icon="calendar" variant="secondary" data-toggle/>
|
||||||
|
@ -95,6 +95,11 @@ function emitChanged() {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function inputChanged() {
|
||||||
|
flatpickrRange.value = ''
|
||||||
|
emitChanged()
|
||||||
|
}
|
||||||
|
|
||||||
watch(
|
watch(
|
||||||
() => flatpickrRange.value,
|
() => flatpickrRange.value,
|
||||||
(newVal: string | null) => {
|
(newVal: string | null) => {
|
||||||
|
@ -119,7 +124,7 @@ function setDateRange(range: string[] | null) {
|
||||||
if (range === null) {
|
if (range === null) {
|
||||||
from.value = ''
|
from.value = ''
|
||||||
to.value = ''
|
to.value = ''
|
||||||
emitChanged()
|
inputChanged()
|
||||||
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
@ -127,7 +132,7 @@ function setDateRange(range: string[] | null) {
|
||||||
from.value = range[0]
|
from.value = range[0]
|
||||||
to.value = range[1]
|
to.value = range[1]
|
||||||
|
|
||||||
emitChanged()
|
inputChanged()
|
||||||
}
|
}
|
||||||
|
|
||||||
const dateRanges = {
|
const dateRanges = {
|
||||||
|
|
Loading…
Reference in a new issue