From 920b0622f6bddbdca40c0f548bb5c041b7a1313b Mon Sep 17 00:00:00 2001 From: ItzNotABug Date: Mon, 30 Sep 2024 15:00:20 +0530 Subject: [PATCH] update: time format. --- src/lib/helpers/backups.ts | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/src/lib/helpers/backups.ts b/src/lib/helpers/backups.ts index b452eeb0b..600469e00 100644 --- a/src/lib/helpers/backups.ts +++ b/src/lib/helpers/backups.ts @@ -92,14 +92,6 @@ export const backupFrequencies = { hourly: generateHourlyOptions(1, 12) }; -const formatTime24to12 = (time24: string) => { - const [hour, minute] = time24.split(':'); - const hourInt = parseInt(hour, 10); - const suffix = hourInt >= 12 ? 'PM' : 'AM'; - const hour12 = ((hourInt + 11) % 12) + 1; - return `${hour12}:${minute} ${suffix}`; -}; - export const backupPolicyDescription = ( frequency: string, time: string | null = null, @@ -107,8 +99,8 @@ export const backupPolicyDescription = ( monthlyBackupFrequency: string, weeklySelectedDays: string[] | null = null ) => { - const timeFormatted = time ? formatTime24to12(time) : ''; let retainedText = ''; + const timeFormatted = time ?? ''; if (retained !== null) { if (retained === 365 * 100) {