From 02b2ed38816fe11be3834dc1494b3e2bb5f8381c Mon Sep 17 00:00:00 2001 From: daurnimator Date: Sun, 22 Apr 2018 21:09:16 +1000 Subject: src/loslib.js: invert ternaries --- src/loslib.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'src') 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); -- cgit v1.2.3-70-g09d2