Fix countdown damage
This commit is contained in:
@@ -14,7 +14,7 @@ function update_time() {
|
|||||||
|
|
||||||
const dur = Math.floor((target - now) / 1000);
|
const dur = Math.floor((target - now) / 1000);
|
||||||
|
|
||||||
const day = Math.floor(dur / 86400).toFixed(0).padStart(2, "0");
|
const day = Math.floor(dur / 86400).toFixed(0);
|
||||||
const hour = Math.floor((dur / 3600) % 24).toFixed(0).padStart(2, "0");
|
const hour = Math.floor((dur / 3600) % 24).toFixed(0).padStart(2, "0");
|
||||||
const min = Math.floor((dur / 60) % 60).toFixed(0).padStart(2, "0");
|
const min = Math.floor((dur / 60) % 60).toFixed(0).padStart(2, "0");
|
||||||
const sec = Math.floor(dur % 60).toFixed(0).padStart(2, "0");
|
const sec = Math.floor(dur % 60).toFixed(0).padStart(2, "0");
|
||||||
@@ -23,7 +23,11 @@ function update_time() {
|
|||||||
//const targettime = `${target.getHours()}:${target.getMinutes()}`
|
//const targettime = `${target.getHours()}:${target.getMinutes()}`
|
||||||
|
|
||||||
//countdown.innerHTML = `${targetdate} v ${targettime}<br><br>${day}:${hour}:${min}:${sec}`;
|
//countdown.innerHTML = `${targetdate} v ${targettime}<br><br>${day}:${hour}:${min}:${sec}`;
|
||||||
countdown.innerHTML = `${day}:${hour}:${min}:${sec}`;
|
if (day == "0") {
|
||||||
|
countdown.innerHTML = `${hour}:${min}:${sec}`;
|
||||||
|
} else {
|
||||||
|
countdown.innerHTML = `${day} dní ${hour}:${min}:${sec}`;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
update_time();
|
update_time();
|
||||||
|
Reference in New Issue
Block a user