From 82c3899e714cbb1a62b75c0e39c9d20c28d47f16 Mon Sep 17 00:00:00 2001 From: Yash Chaudhari Date: Sat, 2 Nov 2024 22:09:08 +0530 Subject: [PATCH] fixed 24 hour clock --- src/utils/clockUtils.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/utils/clockUtils.ts b/src/utils/clockUtils.ts index dff14eb..8e26c72 100644 --- a/src/utils/clockUtils.ts +++ b/src/utils/clockUtils.ts @@ -2,7 +2,7 @@ export const getTime = (currentDateObj: Date, is12HourFormat = true) => { let hours = currentDateObj.getHours(); const minutes = currentDateObj.getMinutes(); - const meridiem = hours < 12 ? "AM" : "PM"; + const meridiem = is12HourFormat && (hours < 12 ? "AM" : "PM"); // Converts hours to 12-hour format if (is12HourFormat) {