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",
|
"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",
|
||||||
|
|
|
@ -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:
|
||||||
|
|
Loading…
Reference in New Issue