feat: Edit relative reminders #3248

Merged
konrad merged 27 commits from ce72/frontend:main into main 2023-06-10 17:04:10 +00:00
2 changed files with 7 additions and 7 deletions
Showing only changes of commit 098b5fa2b1 - Show all commits

View File

@ -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) {

View File

@ -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
}
}
}