diff --git a/scavenger2022/core/templates/core/base.html b/scavenger2022/core/templates/core/base.html index a28af01..c00c69d 100644 --- a/scavenger2022/core/templates/core/base.html +++ b/scavenger2022/core/templates/core/base.html @@ -24,10 +24,10 @@ d = (end - Date.now()) / 1000 start = false } - const hour = Math.round(d / 3600 % 24) - 1 - const minute = Math.round(d / 60 % 60) - const second = Math.round(d % 60) - const day = Math.round(d % (3600*24) / (3600*24)) + const day = Math.floor(d / 86400) + const hour = Math.floor((d - day * 86400) / 3600) + const minute = Math.floor((d - day * 86400 - hour * 3600) / 60) + const second = d % 60 let s = '' if (day == 1) s += '1 day, ' else if (day == 0);