aboutsummaryrefslogtreecommitdiff
path: root/utils
diff options
context:
space:
mode:
Diffstat (limited to 'utils')
-rw-r--r--utils/numberUtils.js14
1 files changed, 14 insertions, 0 deletions
diff --git a/utils/numberUtils.js b/utils/numberUtils.js
index 63240de..96a6b74 100644
--- a/utils/numberUtils.js
+++ b/utils/numberUtils.js
@@ -75,5 +75,19 @@ module.exports = {
}
return interval + '' + intervalType;
+ },
+ timeNumber: function(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){
+ 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