fix(task): don't immediately re-trigger date change when nothing changed
Resolves https://community.vikunja.io/t/reminder-duplication/76/21?u=kolaente
This commit is contained in:
parent
a8441c72b8
commit
13d63e34aa
@ -128,6 +128,10 @@ const flatPickrDate = computed({
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const oldDate = formatDate(date.value, 'yyy-LL-dd H:mm')
|
||||||
|
if (oldDate !== newValue) {
|
||||||
|
return
|
||||||
|
}
|
||||||
date.value = createDateFromString(newValue)
|
date.value = createDateFromString(newValue)
|
||||||
updateData()
|
updateData()
|
||||||
},
|
},
|
||||||
@ -155,10 +159,6 @@ function updateData() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function setDate(dateString: string) {
|
function setDate(dateString: string) {
|
||||||
if (date.value === null) {
|
|
||||||
date.value = new Date()
|
|
||||||
}
|
|
||||||
|
|
||||||
const interval = calculateDayInterval(dateString)
|
const interval = calculateDayInterval(dateString)
|
||||||
const newDate = new Date()
|
const newDate = new Date()
|
||||||
newDate.setDate(newDate.getDate() + interval)
|
newDate.setDate(newDate.getDate() + interval)
|
||||||
@ -166,7 +166,6 @@ function setDate(dateString: string) {
|
|||||||
newDate.setMinutes(0)
|
newDate.setMinutes(0)
|
||||||
newDate.setSeconds(0)
|
newDate.setSeconds(0)
|
||||||
date.value = newDate
|
date.value = newDate
|
||||||
flatPickrDate.value = newDate
|
|
||||||
updateData()
|
updateData()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user