Fix countdown

This commit is contained in:
MrLetsplay 2024-12-31 13:17:56 +01:00
parent afca93e6cf
commit 7853b6992b
Signed by: mr
SSH Key Fingerprint: SHA256:92jBH80vpXyaZHjaIl47pjRq+Yt7XGTArqQg1V7hSqg

View File

@ -70,7 +70,7 @@ setInterval(() => {
} else {
const nextYear = new Date('1970-01-01 00:00');
nextYear.setFullYear(theTime.getFullYear() + 1);
const timeUntilMidnight = Math.floor((nextYear - theTime) / 1000);
const timeUntilMidnight = Math.ceil((nextYear - theTime) / 1000);
if (timeUntilMidnight < 4 * 60 * 60) {
state = STATE_COUNTDOWN;
@ -105,7 +105,7 @@ setInterval(() => {
const nextYear = new Date('1970-01-01 00:00');
nextYear.setFullYear(theTime.getFullYear() + 1);
const timeUntilMidnight = Math.floor((nextYear - theTime) / 1000);
const timeUntilMidnight = Math.ceil((nextYear - theTime) / 1000);
const hours = "" + Math.floor(timeUntilMidnight / (60 * 60));
const minutes = "" + Math.floor((timeUntilMidnight / 60) % 60);
const seconds = "" + Math.floor(timeUntilMidnight % 60);