From 13d63e34aa006ae8f97cb22b597f2fcb1c31f7bf Mon Sep 17 00:00:00 2001 From: kolaente Date: Wed, 10 Jan 2024 23:27:14 +0100 Subject: [PATCH] fix(task): don't immediately re-trigger date change when nothing changed Resolves https://community.vikunja.io/t/reminder-duplication/76/21?u=kolaente --- src/components/input/datepickerInline.vue | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/components/input/datepickerInline.vue b/src/components/input/datepickerInline.vue index 0b6e754b6..4235c8c0a 100644 --- a/src/components/input/datepickerInline.vue +++ b/src/components/input/datepickerInline.vue @@ -128,6 +128,10 @@ const flatPickrDate = computed({ return } + const oldDate = formatDate(date.value, 'yyy-LL-dd H:mm') + if (oldDate !== newValue) { + return + } date.value = createDateFromString(newValue) updateData() }, @@ -155,10 +159,6 @@ function updateData() { } function setDate(dateString: string) { - if (date.value === null) { - date.value = new Date() - } - const interval = calculateDayInterval(dateString) const newDate = new Date() newDate.setDate(newDate.getDate() + interval) @@ -166,7 +166,6 @@ function setDate(dateString: string) { newDate.setMinutes(0) newDate.setSeconds(0) date.value = newDate - flatPickrDate.value = newDate updateData() }