From cf722ea35b1560ed863862139baad28e8a2e64a4 Mon Sep 17 00:00:00 2001 From: Stefan Dej Date: Sat, 8 Jun 2024 23:41:44 +0200 Subject: [PATCH] fix: fix duration format function (#1894) Signed-off-by: Stefan Dej --- src/components/panels/Status/PrintstatusPrinting.vue | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/components/panels/Status/PrintstatusPrinting.vue b/src/components/panels/Status/PrintstatusPrinting.vue index 2f19780ca..400b96d42 100644 --- a/src/components/panels/Status/PrintstatusPrinting.vue +++ b/src/components/panels/Status/PrintstatusPrinting.vue @@ -239,13 +239,13 @@ export default class StatusPanelPrintstatusPrinting extends Mixins(BaseMixin) { } formatDuration(seconds: number) { - let prefix = seconds < 0 ? '-' : '' + const prefix = seconds < 0 ? '-' : '' let absSeconds = Math.abs(seconds) - let h = Math.floor(absSeconds / 3600) + const h = Math.floor(absSeconds / 3600) absSeconds %= 3600 - let m = ('0' + Math.floor(absSeconds / 60)).slice(-2) - let s = ('0' + (absSeconds % 60).toFixed(0)).slice(-2) + const m = ('0' + Math.floor(absSeconds / 60)).slice(-2) + const s = ('0' + Math.floor(absSeconds % 60)).slice(-2) return prefix + h + ':' + m + ':' + s }