Make flatpickr dates work
continuous-integration/drone/pr Build is passing
Details
continuous-integration/drone/pr Build is passing
Details
This commit is contained in:
parent
33b9160a24
commit
85ce39eca0
|
@ -94,7 +94,7 @@
|
||||||
<flat-pickr
|
<flat-pickr
|
||||||
:config="flatPickerConfig"
|
:config="flatPickerConfig"
|
||||||
class="input"
|
class="input"
|
||||||
v-model="date"
|
v-model="flatPickrDate"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</transition>
|
</transition>
|
||||||
|
@ -124,6 +124,9 @@ export default {
|
||||||
time_24hr: true,
|
time_24hr: true,
|
||||||
inline: true,
|
inline: true,
|
||||||
},
|
},
|
||||||
|
// Since flatpickr dates are strings, we need to convert them to native date objects.
|
||||||
|
// To make that work, we need a separate variable since flatpickr does not have a change event.
|
||||||
|
flatPickrDate: null,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
components: {
|
components: {
|
||||||
|
@ -149,6 +152,10 @@ export default {
|
||||||
value(newVal) {
|
value(newVal) {
|
||||||
this.date = newVal
|
this.date = newVal
|
||||||
},
|
},
|
||||||
|
flatPickrDate(newVal) {
|
||||||
|
this.date = new Date(newVal)
|
||||||
|
this.updateData()
|
||||||
|
},
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
updateData() {
|
updateData() {
|
||||||
|
|
Reference in New Issue