diff options
author | Soopyboo32 <49228220+Soopyboo32@users.noreply.github.com> | 2022-05-28 10:13:46 +0800 |
---|---|---|
committer | Soopyboo32 <49228220+Soopyboo32@users.noreply.github.com> | 2022-05-28 10:13:46 +0800 |
commit | 0985bdd291c3b2889c1e2fbc20f51cd4d7bc1e96 (patch) | |
tree | dff55b4700a76efe77a919e666542863b94c187a /utils | |
parent | d017ab83bb7ffbc10e7cde0014116464c725f37f (diff) | |
download | SoopyV2-0985bdd291c3b2889c1e2fbc20f51cd4d7bc1e96.tar.gz SoopyV2-0985bdd291c3b2889c1e2fbc20f51cd4d7bc1e96.tar.bz2 SoopyV2-0985bdd291c3b2889c1e2fbc20f51cd4d7bc1e96.zip |
+ Ok actually fix it this time (i tested)
Diffstat (limited to 'utils')
-rw-r--r-- | utils/numberUtils.js | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/utils/numberUtils.js b/utils/numberUtils.js index 82a6805..597a538 100644 --- a/utils/numberUtils.js +++ b/utils/numberUtils.js @@ -1,4 +1,4 @@ -module.exports = { +let utils = { numberWithCommas: function (x) { if (x === undefined) { return "" } var parts = x.toString().split("."); @@ -76,26 +76,27 @@ module.exports = { return interval + '' + intervalType; }, - timeSince2: function (date) { + timeSince2: (date) => { let time = Date.now() - date if (time > 30 * 60000) { - return this.timeNumber2(time) + return utils.timeNumber2(time) } - return this.timeNumber(time) + return utils.timeNumber(time) }, - timeNumber: function (time) { + timeNumber: (time) => { let mins = Math.floor(time / 1000 / 60) let secs = Math.floor(time / 1000) % 60 if (mins === 0) return secs + "s" return `${mins}m ${secs}s` }, - timeNumber2: function (time) { + timeNumber2: (time) => { let hours = Math.floor(time / 1000 / 60 / 60) let mins = Math.floor(time / 1000 / 60) % 60 if (hours === 0) return mins + "m" return `${hours}h ${mins}m` } -}
\ No newline at end of file +} +module.exports = utils
\ No newline at end of file |