mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-04-23 01:54:49 +01:00
Fix getSunday function
This commit is contained in:
parent
347972d103
commit
22097a0c95
@ -117,9 +117,9 @@ export function randSeedEasedWeightedItem<T>(items: T[], easingFunction: string
|
|||||||
}
|
}
|
||||||
|
|
||||||
export function getSunday(date: Date): Date {
|
export function getSunday(date: Date): Date {
|
||||||
const day = date.getDay();
|
const day = date.getUTCDay();
|
||||||
const diff = date.getDate() - day;
|
const diff = date.getUTCDate() - day;
|
||||||
const newDate = new Date(date.setDate(diff));
|
const newDate = new Date(date.setUTCDate(diff));
|
||||||
return new Date(Date.UTC(newDate.getUTCFullYear(), newDate.getUTCMonth(), newDate.getUTCDate()));
|
return new Date(Date.UTC(newDate.getUTCFullYear(), newDate.getUTCMonth(), newDate.getUTCDate()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user