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
|
||||
:config="flatPickerConfig"
|
||||
class="input"
|
||||
v-model="date"
|
||||
v-model="flatPickrDate"
|
||||
/>
|
||||
</div>
|
||||
</transition>
|
||||
|
@ -124,6 +124,9 @@ export default {
|
|||
time_24hr: 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: {
|
||||
|
@ -149,6 +152,10 @@ export default {
|
|||
value(newVal) {
|
||||
this.date = newVal
|
||||
},
|
||||
flatPickrDate(newVal) {
|
||||
this.date = new Date(newVal)
|
||||
this.updateData()
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
updateData() {
|
||||
|
|
Reference in New Issue