1
0
Fork 0
mirror of synced 2024-09-08 13:41:09 +12:00

Fix flatpickr random error

This commit is contained in:
Andrew Kingston 2022-11-17 10:16:27 +00:00
parent 102d6084f1
commit 43fb581fde

View file

@ -23,6 +23,15 @@
let open = false
let flatpickr, flatpickrOptions
// Another classic flatpickr issue. Errors were randomly being thrown due to
// flatpickr internal code. Making sure that "destroy" is a valid function
// fixes it. The sooner we remove flatpickr the better.
$: {
if (flatpickr && !flatpickr.destroy) {
flatpickr.destroy = () => {}
}
}
const resolveTimeStamp = timestamp => {
let maskedDate = new Date(`0-${timestamp}`)