Merge branch '333-recurrent-preserve-due-datetime' into 'master'

new events: preserve due date and time when switching to recurrent.

Closes #333

See merge request les/gancio!57
This commit is contained in:
les 2024-10-31 11:34:57 +00:00
commit b6e6df5e4c
2 changed files with 6 additions and 2 deletions

View file

@ -210,7 +210,11 @@ export default {
if (what === 'type') {
if (typeof value === 'undefined') { this.type = 'normal' }
if (value === 'recurrent') {
this.$emit('input', { ...this.value, due: null, recurrent: { frequency: '1w' }, multidate: false })
if (this.value.multidate && this.value.due) {
this.$emit('input', { ...this.value, due: this.value.from, recurrent: { frequency: '1w' }, multidate: false })
} else {
this.$emit('input', { ...this.value, recurrent: { frequency: '1w' }, multidate: false })
}
} else if (value === 'multidate') {
this.$emit('input', { ...this.value, recurrent: null, multidate: true })
} else {

View file

@ -259,7 +259,7 @@ export default {
formData.append('start_datetime', this.$time.fromDateInput(this.date.from, this.date.fromHour))
if (!!this.date.multidate) {
formData.append('end_datetime', this.$time.fromDateInput(this.date.due, this.date.dueHour || '23:59'))
} else if (this.date.dueHour) {
} else if (this.date.dueHour && this.date.due) {
formData.append('end_datetime', this.$time.fromDateInput(this.date.due, this.date.dueHour))
} else {
formData.append('end_datetime', '')