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) }}
|
||||
</SimpleButton>
|
||||
<SimpleButton
|
||||
@click="showFormSwitch = 'relative'"
|
||||
<SimpleButton
|
||||
@click="showFormSwitch = 'relative'"
|
||||
class="option-button"
|
||||
: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') }}
|
||||
</SimpleButton>
|
||||
<SimpleButton
|
||||
@click="showFormSwitch = 'absolute'"
|
||||
<SimpleButton
|
||||
@click="showFormSwitch = 'absolute'"
|
||||
class="option-button"
|
||||
:class="{'currently-active': modelValue?.relativeTo === null}"
|
||||
>
|
||||
@ -164,10 +164,7 @@ function updateDataAndMaybeClose(toggle) {
|
||||
}
|
||||
|
||||
function formatReminder(reminder: TaskReminderModel) {
|
||||
|
||||
const period = secondsToPeriod(reminder.relativePeriod)
|
||||
|
||||
// TODO: 0 does not work
|
||||
|
||||
if (period.amount === 0) {
|
||||
switch (reminder.relativeTo) {
|
||||
|
@ -12,6 +12,9 @@ export default class TaskReminderModel extends AbstractModel<ITaskReminder> impl
|
||||
super()
|
||||
this.assignData(data)
|
||||
this.reminder = parseDateOrNull(data.reminder)
|
||||
if (this.relativeTo === '') {
|
||||
this.relativeTo = null
|
||||
}
|
||||
}
|
||||
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user