aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authordaurnimator <quae@daurnimator.com>2018-04-22 21:09:16 +1000
committerdaurnimator <quae@daurnimator.com>2018-04-22 21:20:45 +1000
commit02b2ed38816fe11be3834dc1494b3e2bb5f8381c (patch)
tree166b8aab5cb76a6d2e07db86d0c38e949ae52ebc /src
parentf6a9b5adb12fe92ebaaa20d9707d7945406ae533 (diff)
downloadfengari-02b2ed38816fe11be3834dc1494b3e2bb5f8381c.tar.gz
fengari-02b2ed38816fe11be3834dc1494b3e2bb5f8381c.tar.bz2
fengari-02b2ed38816fe11be3834dc1494b3e2bb5f8381c.zip
src/loslib.js: invert ternaries
Diffstat (limited to 'src')
-rw-r--r--src/loslib.js14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/loslib.js b/src/loslib.js
index d20873d..cc43e3b 100644
--- a/src/loslib.js
+++ b/src/loslib.js
@@ -69,13 +69,13 @@ const setfield = function(L, key, value) {
};
const setallfields = function(L, time, utc) {
- setfield(L, "sec", !utc ? time.getSeconds() : time.getUTCSeconds());
- setfield(L, "min", !utc ? time.getMinutes() : time.getUTCMinutes());
- setfield(L, "hour", !utc ? time.getHours() : time.getUTCHours());
- setfield(L, "day", !utc ? time.getDate() : time.getUTCDate());
- setfield(L, "month", (!utc ? time.getMonth() : time.getUTCMonth()) + 1);
- setfield(L, "year", !utc ? time.getFullYear() : time.getUTCFullYear());
- setfield(L, "wday", !utc ? time.getDay() : time.getUTCDay());
+ setfield(L, "sec", utc ? time.getUTCSeconds() : time.getSeconds());
+ setfield(L, "min", utc ? time.getUTCMinutes() : time.getMinutes());
+ setfield(L, "hour", utc ? time.getUTCHours() : time.getHours());
+ 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());
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);