Use local time to calculate weekday

Fixes an issue where a year's doomsday is incorrectly calculated depending on the timezone.
This commit is contained in:
Florine W. Dekker 2022-03-02 12:39:17 +01:00
parent d6060b1a1d
commit 70d41cf072
Signed by: FWDekker
GPG Key ID: D3DCFAA8A4560BE0
2 changed files with 2 additions and 2 deletions

View File

@ -1,6 +1,6 @@
{ {
"name": "doomsday", "name": "doomsday",
"version": "1.3.18", "version": "1.3.19",
"description": "Test your mastery of Conway's Doomsday rule.", "description": "Test your mastery of Conway's Doomsday rule.",
"author": "Florine W. Dekker", "author": "Florine W. Dekker",
"browser": "dist/bundle.js", "browser": "dist/bundle.js",

View File

@ -290,7 +290,7 @@ class DoomsdayDate {
*/ */
static getWeekDayOf(date) { static getWeekDayOf(date) {
if (date instanceof Date) { if (date instanceof Date) {
return date.toLocaleString("en-US", {timeZone: "GMT", weekday: "long"}); return date.toLocaleString("en-US", {weekday: "long"});
} else { } else {
switch (date % 7) { switch (date % 7) {
case 0: case 0: