From 1c9c76f721a493d002662333f93edec67fd9bf20 Mon Sep 17 00:00:00 2001 From: Liam Date: Sat, 28 Sep 2024 06:20:42 +0100 Subject: [PATCH] now? --- src/common/time-utils.ts | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/common/time-utils.ts b/src/common/time-utils.ts index 6d075da..a24e0bd 100644 --- a/src/common/time-utils.ts +++ b/src/common/time-utils.ts @@ -34,13 +34,9 @@ export function timeAgo(input: Date | number) { * @param date the date */ export function getMidnightAlignedDate(date: Date) { - const midnightDate = new Date( - date.getFullYear(), - date.getMonth(), - date.getDate(), + return new Date( + Date.UTC(date.getUTCFullYear(), date.getUTCMonth(), date.getUTCDate()), ); - midnightDate.setUTCHours(0, 0, 0, 0); - return midnightDate; } /**