diff options
author | daurnimator <quae@daurnimator.com> | 2018-04-22 21:00:58 +1000 |
---|---|---|
committer | daurnimator <quae@daurnimator.com> | 2018-04-22 21:20:45 +1000 |
commit | f6a9b5adb12fe92ebaaa20d9707d7945406ae533 (patch) | |
tree | 07b80eef5144a2b8332513392093c6858b25511e /src | |
parent | 8ffcac749ad1153fd01cc7c0d40a338090bd1c38 (diff) | |
download | fengari-f6a9b5adb12fe92ebaaa20d9707d7945406ae533.tar.gz fengari-f6a9b5adb12fe92ebaaa20d9707d7945406ae533.tar.bz2 fengari-f6a9b5adb12fe92ebaaa20d9707d7945406ae533.zip |
src/loslib.js: Fix off-by-one error in month field of os.time()
Diffstat (limited to 'src')
-rw-r--r-- | src/loslib.js | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/loslib.js b/src/loslib.js index c282175..d20873d 100644 --- a/src/loslib.js +++ b/src/loslib.js @@ -73,7 +73,7 @@ const setallfields = function(L, time, utc) { 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()); + 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()); let now = new Date(); |