Fix getSunday function
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…
Reference in New Issue