Fix countdown
This commit is contained in:
parent
afca93e6cf
commit
7853b6992b
@ -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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user