From 22097a0c956270a2fe8d510c5ae457d574fd1e5e Mon Sep 17 00:00:00 2001 From: Xavion3 Date: Mon, 13 May 2024 11:16:50 +1000 Subject: [PATCH] Fix getSunday function --- src/utils.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/utils.ts b/src/utils.ts index 7ec4256e2..ad0673e90 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -117,9 +117,9 @@ export function randSeedEasedWeightedItem(items: T[], easingFunction: string } export function getSunday(date: Date): Date { - const day = date.getDay(); - const diff = date.getDate() - day; - const newDate = new Date(date.setDate(diff)); + const day = date.getUTCDay(); + const diff = date.getUTCDate() - day; + const newDate = new Date(date.setUTCDate(diff)); return new Date(Date.UTC(newDate.getUTCFullYear(), newDate.getUTCMonth(), newDate.getUTCDate())); }