mirror of
https://framagit.org/les/gancio.git
synced 2025-02-01 00:52:01 +01:00
fix issue adding event with dueHour -> 'bad request'
This commit is contained in:
parent
23b28dba95
commit
d2511f3ad5
1 changed files with 4 additions and 4 deletions
|
@ -205,14 +205,14 @@ export default {
|
||||||
const fromHour = dayjs(this.value.from).hour()
|
const fromHour = dayjs(this.value.from).hour()
|
||||||
|
|
||||||
// add a day
|
// add a day
|
||||||
let due = dayjs(this.value.due)
|
let due = dayjs(this.value.from)
|
||||||
if (fromHour > Number(hour) && !this.value.multidate) {
|
if (fromHour > Number(hour) && !this.value.multidate) {
|
||||||
due = due.add(1, 'day')
|
due = due.add(1, 'day')
|
||||||
}
|
}
|
||||||
due = due.hour(hour).minute(minute)
|
due = due.hour(hour).minute(minute)
|
||||||
this.$emit('input', { ...this.value, due, dueHour: true })
|
this.$emit('input', { ...this.value, due, dueHour: true })
|
||||||
} else {
|
} else {
|
||||||
this.$emit('input', { ...this.value, dueHour: false })
|
this.$emit('input', { ...this.value, due: null, dueHour: false })
|
||||||
}
|
}
|
||||||
// change date in calendar (could be a range or a recurrent event...)
|
// change date in calendar (could be a range or a recurrent event...)
|
||||||
} else if (what === 'date') {
|
} else if (what === 'date') {
|
||||||
|
@ -232,11 +232,11 @@ export default {
|
||||||
this.$emit('input', { ...this.value, from, due })
|
this.$emit('input', { ...this.value, from, due })
|
||||||
} else {
|
} else {
|
||||||
let from = value
|
let from = value
|
||||||
let due = null
|
let due = this.value.due
|
||||||
if (this.value.fromHour) {
|
if (this.value.fromHour) {
|
||||||
from = dayjs(value).hour(dayjs(this.value.from).hour())
|
from = dayjs(value).hour(dayjs(this.value.from).hour())
|
||||||
}
|
}
|
||||||
if (this.value.dueHour) {
|
if (this.value.dueHour && this.value.due) {
|
||||||
due = dayjs(value).hour(dayjs(this.value.due).hour())
|
due = dayjs(value).hour(dayjs(this.value.due).hour())
|
||||||
}
|
}
|
||||||
this.$emit('input', { ...this.value, from, due })
|
this.$emit('input', { ...this.value, from, due })
|
||||||
|
|
Loading…
Reference in a new issue