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:
parent
d6060b1a1d
commit
70d41cf072
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "doomsday",
|
||||
"version": "1.3.18",
|
||||
"version": "1.3.19",
|
||||
"description": "Test your mastery of Conway's Doomsday rule.",
|
||||
"author": "Florine W. Dekker",
|
||||
"browser": "dist/bundle.js",
|
||||
|
|
|
@ -290,7 +290,7 @@ class DoomsdayDate {
|
|||
*/
|
||||
static getWeekDayOf(date) {
|
||||
if (date instanceof Date) {
|
||||
return date.toLocaleString("en-US", {timeZone: "GMT", weekday: "long"});
|
||||
return date.toLocaleString("en-US", {weekday: "long"});
|
||||
} else {
|
||||
switch (date % 7) {
|
||||
case 0:
|
||||
|
|
Loading…
Reference in New Issue