summaryrefslogtreecommitdiff
path: root/views/http/components/timer.twig
diff options
context:
space:
mode:
Diffstat (limited to 'views/http/components/timer.twig')
-rw-r--r--views/http/components/timer.twig6
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();
});