aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authordaurnimator <quae@daurnimator.com>2018-04-22 21:16:02 +1000
committerdaurnimator <quae@daurnimator.com>2018-04-22 21:20:45 +1000
commitcb96b5d9527975424ddb70561fce87c947f9ba08 (patch)
tree4d9a8ec25de08ca850ea8654a6e75038bee9db86 /src
parent02b2ed38816fe11be3834dc1494b3e2bb5f8381c (diff)
downloadfengari-cb96b5d9527975424ddb70561fce87c947f9ba08.tar.gz
fengari-cb96b5d9527975424ddb70561fce87c947f9ba08.tar.bz2
fengari-cb96b5d9527975424ddb70561fce87c947f9ba08.zip
src/loslib.js: Fix wday off-by-one error
Diffstat (limited to 'src')
-rw-r--r--src/loslib.js2
1 files changed, 1 insertions, 1 deletions
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);