From cb96b5d9527975424ddb70561fce87c947f9ba08 Mon Sep 17 00:00:00 2001 From: daurnimator Date: Sun, 22 Apr 2018 21:16:02 +1000 Subject: src/loslib.js: Fix wday off-by-one error --- src/loslib.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/loslib.js b/src/loslib.js index cc43e3b..b58b368 100644 --- a/src/loslib.js +++ b/src/loslib.js @@ -75,7 +75,7 @@ const setallfields = function(L, time, utc) { setfield(L, "day", utc ? time.getUTCDate() : time.getDate()); setfield(L, "month", (utc ? time.getUTCMonth() : time.getMonth()) + 1); setfield(L, "year", utc ? time.getUTCFullYear() : time.getFullYear()); - setfield(L, "wday", utc ? time.getUTCDay() : time.getDay()); + setfield(L, "wday", (utc ? time.getUTCDay() : time.getDay()) + 1); let now = new Date(); setfield(L, "yday", Math.floor((now - (new Date(now.getFullYear(), 0, 0))) / (1000 * 60 * 60 * 24))); // setboolfield(L, "isdst", time.get); -- cgit v1.2.3-70-g09d2