diff --git a/src/commands/forward.js b/src/commands/forward.js index 9394748..9fd9d45 100644 --- a/src/commands/forward.js +++ b/src/commands/forward.js @@ -1,5 +1,5 @@ const { EmbedBuilder } = require('discord.js') -const formatMSHHMMSS = require('../utils/time') +const formatMSHHMMSS = require('../utils/time') module.exports = { name: 'forward', diff --git a/src/utils/time.js b/src/utils/time.js index bdc5b69..59bd1fb 100644 --- a/src/utils/time.js +++ b/src/utils/time.js @@ -1,11 +1,11 @@ -module.exports = function formatMSHHMMSS(num) { - return [86400000, 3600000, 60000, 1000, 1].reduce((p, c) => { - let res = Math.floor(num / c); - num -= res * c; - return [...p, res]; - }, []) - .map((v, i) => i <= 1 && v === 0 ? "" : [i === 4 ? "." : "", v < 10 ? `0${v}` : v, [" Days, ", ":", ":", "", ""][i]].join("")) - .filter(Boolean) - .slice(0, -1) - .join(""); -} \ No newline at end of file +module.exports = function formatMSHHMMSS (num) { + return [86400000, 3600000, 60000, 1000, 1].reduce((p, c) => { + const res = Math.floor(num / c) + num -= res * c + return [...p, res] + }, []) + .map((v, i) => i <= 1 && v === 0 ? '' : [i === 4 ? '.' : '', v < 10 ? `0${v}` : v, [' Days, ', ':', ':', '', ''][i]].join('')) + .filter(Boolean) + .slice(0, -1) + .join('') +}