From 4ba02ebbb6be4b96a42688b3ec8f29fe923aee0b Mon Sep 17 00:00:00 2001 From: kolaente Date: Wed, 31 May 2023 15:07:23 +0200 Subject: [PATCH] fix: don't try to convert a null date Resolves https://kolaente.dev/vikunja/frontend/issues/3371 --- src/components/input/datepicker.vue | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/components/input/datepicker.vue b/src/components/input/datepicker.vue index bc72ee73b..1e3839307 100644 --- a/src/components/input/datepicker.vue +++ b/src/components/input/datepicker.vue @@ -158,7 +158,12 @@ const flatPickerConfig = computed(() => ({ // 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. const flatPickrDate = computed({ - set(newValue: string | Date) { + set(newValue: string | Date | null) { + if (newValue === null) { + date.value = null + return + } + date.value = createDateFromString(newValue) updateData() },