From d10397af9d19f1607a187c749eefd160c9ef7392 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=B4me=20Benoit?= Date: Sat, 18 Sep 2021 13:16:32 +0200 Subject: [PATCH] Simplify calculation at duration formatting MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Jérôme Benoit --- src/utils/Utils.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/utils/Utils.ts b/src/utils/Utils.ts index fb5c88c5..f6565cc5 100644 --- a/src/utils/Utils.ts +++ b/src/utils/Utils.ts @@ -20,8 +20,8 @@ export default class Utils { public static formatDurationMilliSeconds(duration: number): string { duration = Utils.convertToInt(duration); const hours = Math.floor(duration / (3600 * 1000)); - const minutes = Math.floor((duration - (hours * (3600 * 1000))) / (60 * 1000)); - const seconds = (duration - (hours * 3600 * 1000) - (minutes * 60 * 1000)) / 1000; + const minutes = Math.floor((duration / 1000 - (hours * 3600)) / 60); + const seconds = duration / 1000 - (hours * 3600) - (minutes * 60); let hoursStr: string = hours.toString(); let minutesStr: string = minutes.toString(); let secondsStr: string = seconds.toString(); -- 2.34.1