This commit is contained in:
Lee 2024-09-28 06:20:42 +01:00
parent 4cbe227827
commit 1c9c76f721

View File

@ -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;
}
/**