fix: clean due date when switching to recurrent

This commit is contained in:
lesion 2024-10-30 10:24:23 +01:00
parent 64997d312c
commit eb3935d2e6
No known key found for this signature in database
GPG key ID: 352918250B012177
2 changed files with 2 additions and 2 deletions

View file

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

View file

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