From 6e1a5f1cdb0e84c2bfff8e073e5ff28187859161 Mon Sep 17 00:00:00 2001 From: derpystuff <3515180-derpystuff@users.noreply.gitlab.com> Date: Sun, 5 Nov 2023 11:13:53 +0100 Subject: [PATCH] fix hour display --- commands/message/core/stats.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/commands/message/core/stats.js b/commands/message/core/stats.js index af5d190..0bc1df1 100644 --- a/commands/message/core/stats.js +++ b/commands/message/core/stats.js @@ -7,11 +7,13 @@ const { Permissions } = require("detritus-client/lib/constants"); const { OPEN_SOURCE_REPOSITORY_URL } = require('../../../labscore/constants'); function format(seconds){ + function pad(s){ return (s < 10 ? '0' : '') + s; } + var days = Math.floor(seconds / (60*60*24)); - var hours = Math.floor(seconds / (60*60*24) / (60*60)); + var hours = Math.floor(seconds % (60*60*24) / (60*60)); var minutes = Math.floor(seconds % (60*60) / 60); var seconds = Math.floor(seconds % 60);