From 7853b6992bde4b0aa40194da7b88616c39558f0c Mon Sep 17 00:00:00 2001 From: MrLetsplay Date: Tue, 31 Dec 2024 13:17:56 +0100 Subject: [PATCH] Fix countdown --- special/new-year.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/special/new-year.js b/special/new-year.js index 134da36..444ad09 100644 --- a/special/new-year.js +++ b/special/new-year.js @@ -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);