cleanup
This commit is contained in:
parent
7c0aac609b
commit
b088ad497f
@ -1,26 +0,0 @@
|
||||
const endDate = "Sept 1 2022";
|
||||
update();
|
||||
|
||||
function update() {
|
||||
const temp = countdown();
|
||||
let output = "";
|
||||
for (const property in temp) {
|
||||
output += (`${property}: ${temp[property]} `);
|
||||
}
|
||||
console.log(output);
|
||||
setTimeout(update, 1000);
|
||||
}
|
||||
|
||||
function countdown() {
|
||||
const total = Date.parse(endDate) - new Date();
|
||||
const days = Math.floor(total / (1000 * 60 * 60 * 24));
|
||||
const hrs = Math.floor((total / (1000 * 60 * 60)) % 24);
|
||||
const mins = Math.floor((total / 1000 / 60) % 60);
|
||||
const secs = Math.floor((total / 1000) % 60);
|
||||
return {
|
||||
days,
|
||||
hrs,
|
||||
mins,
|
||||
secs
|
||||
};
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user