fix(reminders): properly parse relative reminders which don't have an amount
This commit is contained in:
parent
5e4eb4a728
commit
098b5fa2b1
@ -20,15 +20,15 @@
|
|||||||
>
|
>
|
||||||
{{ formatReminder(p) }}
|
{{ formatReminder(p) }}
|
||||||
</SimpleButton>
|
</SimpleButton>
|
||||||
<SimpleButton
|
<SimpleButton
|
||||||
@click="showFormSwitch = 'relative'"
|
@click="showFormSwitch = 'relative'"
|
||||||
class="option-button"
|
class="option-button"
|
||||||
:class="{'currently-active': typeof modelValue !== 'undefined' && modelValue?.relativeTo !== null && presets.find(p => p.relativePeriod === modelValue?.relativePeriod && modelValue?.relativeTo === p.relativeTo) === undefined}"
|
:class="{'currently-active': typeof modelValue !== 'undefined' && modelValue?.relativeTo !== null && presets.find(p => p.relativePeriod === modelValue?.relativePeriod && modelValue?.relativeTo === p.relativeTo) === undefined}"
|
||||||
>
|
>
|
||||||
{{ $t('task.reminder.custom') }}
|
{{ $t('task.reminder.custom') }}
|
||||||
</SimpleButton>
|
</SimpleButton>
|
||||||
<SimpleButton
|
<SimpleButton
|
||||||
@click="showFormSwitch = 'absolute'"
|
@click="showFormSwitch = 'absolute'"
|
||||||
class="option-button"
|
class="option-button"
|
||||||
:class="{'currently-active': modelValue?.relativeTo === null}"
|
:class="{'currently-active': modelValue?.relativeTo === null}"
|
||||||
>
|
>
|
||||||
@ -164,10 +164,7 @@ function updateDataAndMaybeClose(toggle) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function formatReminder(reminder: TaskReminderModel) {
|
function formatReminder(reminder: TaskReminderModel) {
|
||||||
|
|
||||||
const period = secondsToPeriod(reminder.relativePeriod)
|
const period = secondsToPeriod(reminder.relativePeriod)
|
||||||
|
|
||||||
// TODO: 0 does not work
|
|
||||||
|
|
||||||
if (period.amount === 0) {
|
if (period.amount === 0) {
|
||||||
switch (reminder.relativeTo) {
|
switch (reminder.relativeTo) {
|
||||||
|
@ -12,6 +12,9 @@ export default class TaskReminderModel extends AbstractModel<ITaskReminder> impl
|
|||||||
super()
|
super()
|
||||||
this.assignData(data)
|
this.assignData(data)
|
||||||
this.reminder = parseDateOrNull(data.reminder)
|
this.reminder = parseDateOrNull(data.reminder)
|
||||||
|
if (this.relativeTo === '') {
|
||||||
|
this.relativeTo = null
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
Loading…
x
Reference in New Issue
Block a user