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);