From 7404cc11191589f073a60f6620a49729e96ad9d5 Mon Sep 17 00:00:00 2001 From: ralf Date: Thu, 13 Oct 2022 16:42:23 +0200 Subject: [PATCH] WIP timesheet timers: do NOT round hours for hh:mm display, as 30min will give 1:30, instead of 0:30 --- api/js/jsapi/egw_timer.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/js/jsapi/egw_timer.js b/api/js/jsapi/egw_timer.js index 4add4b0d42..0342d25867 100644 --- a/api/js/jsapi/egw_timer.js +++ b/api/js/jsapi/egw_timer.js @@ -224,7 +224,7 @@ egw.extend('timer', egw.MODULE_GLOBAL, function() sep = now % 2 ? ' ' : ':'; diff = Math.round((now - Math.round(_timer.start.valueOf() / 1000.0)) / 60.0); } - _node.textContent = sprintf('%d%s%02d', Math.round(diff / 60), sep, diff % 60); + _node.textContent = sprintf('%d%s%02d', (diff / 60)|0, sep, diff % 60); // set CSS classes accordingly _node.classList.toggle('running', !!_timer.start); _node.classList.toggle('paused', _timer.paused || false);