Format dates with moment

This commit is contained in:
Daniel Odendahl Jr
2018-09-20 16:38:05 +00:00
parent 553abdb6fa
commit 42bd597db7
26 changed files with 81 additions and 51 deletions
-7
View File
@@ -28,13 +28,6 @@ module.exports = class Util {
return text.length > maxLen ? `${text.substr(0, maxLen - 3)}...` : text;
}
static duration(ms) {
const sec = Math.floor((ms / 1000) % 60).toString();
const min = Math.floor((ms / (1000 * 60)) % 60).toString();
const hrs = Math.floor(ms / (1000 * 60 * 60)).toString();
return `${hrs.padStart(2, '0')}:${min.padStart(2, '0')}:${sec.padStart(2, '0')}`;
}
static randomRange(min, max) {
return Math.floor(Math.random() * (max - min + 1)) + min;
}