From 9d58fb7f36a2950e88e6c8474911882cfe7ed769 Mon Sep 17 00:00:00 2001 From: j Date: Tue, 8 Jul 2025 12:31:53 +0100 Subject: [PATCH] fix rendering of duration on chrome in mobile interface for: -9.99999883788405e-7 --- static/mobile/js/utils.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/static/mobile/js/utils.js b/static/mobile/js/utils.js index 92d6c8064..25e8a4017 100644 --- a/static/mobile/js/utils.js +++ b/static/mobile/js/utils.js @@ -6,11 +6,15 @@ const parseDuration = function(string) { }; const formatDuration = function(seconds) { + if (isString(seconds)) { + seconds = parseFloat(seconds) + } + seconds = seconds.toFixed(3) var parts = [ parseInt(seconds / 86400), parseInt(seconds % 86400 / 3600), parseInt(seconds % 3600 / 60), - s = parseInt(seconds % 60) + parseInt(seconds % 60) ] return parts.map(p => { return p.toString().padStart(2, '0')}).join(':') }