From 3af67e5e537765d3048aa86179448973350e6564 Mon Sep 17 00:00:00 2001 From: Franziska Kunsmann Date: Mon, 10 Mar 2025 05:20:09 +0100 Subject: [PATCH] room timer: use more standard timer layout, properly show length bigger than one hour --- .../static/pretalx_broadcast_tools/room_timer.js | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/pretalx_broadcast_tools/static/pretalx_broadcast_tools/room_timer.js b/pretalx_broadcast_tools/static/pretalx_broadcast_tools/room_timer.js index b00442d..bcc50c9 100644 --- a/pretalx_broadcast_tools/static/pretalx_broadcast_tools/room_timer.js +++ b/pretalx_broadcast_tools/static/pretalx_broadcast_tools/room_timer.js @@ -66,10 +66,15 @@ function update_room_info() { timehint.innerHTML = 'talk has ended'; } else { diff = scheduled_end - now; - let diff_s = Math.floor(Math.floor(diff / 1000) % 60); - let diff_m = Math.floor(diff / 1000 / 60); + let diff_s = Math.floor(diff / 1000) % 60; + let diff_m = Math.floor(diff / 1000 / 60) % 60; + let diff_h = Math.floor(diff / 1000 / 60 / 60); - timeleft.innerHTML = diff_m + 'min ' + diff_s + 'sec'; + if (diff_h > 0) { + timeleft.innerHTML = diff_h + ":" + _left_zero_pad(diff_m) + ":" + _left_zero_pad(diff_s); + } else { + timeleft.innerHTML = diff_m + ":" + _left_zero_pad(diff_s); + } total_time = scheduled_end - scheduled_start; progressbar_bar.style.width = (((diff/total_time)*100)-100)*-1 + 'vw';