From d58f61770463aab2c71464c11f902f0074b49b62 Mon Sep 17 00:00:00 2001 From: Daniel Weipert Date: Mon, 15 Jan 2024 15:50:43 +0100 Subject: http catch-up --- views/http/components/timer.twig | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'views/http/components') diff --git a/views/http/components/timer.twig b/views/http/components/timer.twig index ccb31a7..4898a2e 100644 --- a/views/http/components/timer.twig +++ b/views/http/components/timer.twig @@ -14,12 +14,18 @@ document.addEventListener('DOMContentLoaded', function (ev) { window.location.reload(); } + const dd = Math.floor(diff/1000/60/60/24); + diff -= dd*1000*60*60*24; const hh = Math.floor(diff/1000/60/60); diff -= hh*1000*60*60; const mm = Math.floor(diff/1000/60); diff -= mm*1000*60; const ss = Math.floor(diff/1000); + timer.innerHTML = `${('00' + hh).slice(-2)}:${('00' + mm).slice(-2)}:${('00' + ss).slice(-2)}`; + if (dd > 0) { + timer.innerHTML = `${('00' + dd).slice(-2)}:${timer.innerHTML}`; + } } setTime(); }); -- cgit v1.2.3