mirror of
https://framagit.org/les/gancio.git
synced 2025-02-01 00:52:01 +01:00
fix: if a user edits an event by postponing it, say by a week, without changing the hours, the end date should be recalculate
This commit is contained in:
parent
0f047a264e
commit
6c2840a7fa
1 changed files with 8 additions and 0 deletions
|
@ -270,6 +270,14 @@ export default {
|
|||
} else {
|
||||
let from = value
|
||||
let due = this.value.due
|
||||
// if a user edits an event by postponing it, say by a week, without changing the hours, the end date should be recalculate
|
||||
if (this.value.from) {
|
||||
let newDueDate = new Date(value).toDateString()
|
||||
if (this.value.dueHour < this.value.fromHour) {
|
||||
newDueDate = new Date(DateTime.fromJSDate(from, {zone: this.settings.instance_timezone}).plus({day: 1}).toJSDate()).toDateString()
|
||||
}
|
||||
due = new Date(newDueDate + " " + this.value.dueHour)
|
||||
}
|
||||
this.$emit('input', { ...this.value, from, due })
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue