fix(reminders): do not fall back to hours when the reminder interval is minutes

Resolves https://github.com/go-vikunja/vikunja/issues/225
This commit is contained in:
kolaente 2024-04-14 11:20:20 +02:00
parent 144a6e4140
commit fd520dab0a
Signed by untrusted user: konrad
GPG Key ID: F40E70337AB24C9B
1 changed files with 7 additions and 0 deletions

View File

@ -19,6 +19,13 @@ export function secondsToPeriod(seconds: number): { unit: PeriodUnit, amount: nu
}
}
if (seconds % SECONDS_A_MINUTE === 0) {
return {
unit: 'minutes',
amount: seconds / SECONDS_A_MINUTE,
}
}
return {
unit: 'hours',
amount: seconds / SECONDS_A_HOUR,