diff options
author | Daniel Weipert <git@mail.dweipert.de> | 2024-01-15 15:50:43 +0100 |
---|---|---|
committer | Daniel Weipert <git@mail.dweipert.de> | 2024-01-15 15:50:43 +0100 |
commit | d58f61770463aab2c71464c11f902f0074b49b62 (patch) | |
tree | 97f55098caa342c1146f4e0bdc9f299affb62739 /views/http/components | |
parent | 2d0da0b920035c90d56db5dbec6d62f5b50ba0c2 (diff) |
Diffstat (limited to 'views/http/components')
-rw-r--r-- | views/http/components/timer.twig | 6 |
1 files changed, 6 insertions, 0 deletions
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(); }); |