From 15e0c716adce2d6f2acb87406dfe0467e7079855 Mon Sep 17 00:00:00 2001 From: kolaente Date: Mon, 22 Apr 2024 00:05:12 +0200 Subject: [PATCH] fix(reminders): do not show relative reminders as minutes when they round to hours Regression from fd520dab0a6767eb47a98b04cd3f833f337218e5 --- frontend/src/helpers/time/period.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/frontend/src/helpers/time/period.ts b/frontend/src/helpers/time/period.ts index 94a44a682..303137d52 100644 --- a/frontend/src/helpers/time/period.ts +++ b/frontend/src/helpers/time/period.ts @@ -19,16 +19,16 @@ export function secondsToPeriod(seconds: number): { unit: PeriodUnit, amount: nu } } - if (seconds % SECONDS_A_MINUTE === 0) { + if (seconds % SECONDS_A_HOUR === 0) { return { - unit: 'minutes', - amount: seconds / SECONDS_A_MINUTE, + unit: 'hours', + amount: seconds / SECONDS_A_HOUR, } } - + return { - unit: 'hours', - amount: seconds / SECONDS_A_HOUR, + unit: 'minutes', + amount: seconds / SECONDS_A_MINUTE, } }