From fd520dab0a6767eb47a98b04cd3f833f337218e5 Mon Sep 17 00:00:00 2001 From: kolaente Date: Sun, 14 Apr 2024 11:20:20 +0200 Subject: [PATCH] fix(reminders): do not fall back to hours when the reminder interval is minutes Resolves https://github.com/go-vikunja/vikunja/issues/225 --- frontend/src/helpers/time/period.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/frontend/src/helpers/time/period.ts b/frontend/src/helpers/time/period.ts index 0e56eaa5c..94a44a682 100644 --- a/frontend/src/helpers/time/period.ts +++ b/frontend/src/helpers/time/period.ts @@ -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,