mirror of
https://github.com/hexahigh/080609.git
synced 2025-12-11 19:55:06 +01:00
made it fully automatic
This commit is contained in:
parent
94ac4e6fa4
commit
62ae6efea9
4
index.js
4
index.js
@ -7,10 +7,12 @@ function calculateYearsSince(date) {
|
||||
const myDate = new Date('2009-08-06');
|
||||
document.getElementById("age").innerText = calculateYearsSince(myDate) + " Years old";
|
||||
|
||||
const currentYear = new Date().getFullYear();
|
||||
const theDate = currentYear + "-06-08"
|
||||
|
||||
function countdownTimer() {
|
||||
const now = new Date().getTime();
|
||||
const nextYear = new Date("2023-06-08").getTime();
|
||||
const nextYear = new Date(theDate).getTime();
|
||||
const timeRemaining = nextYear - now;
|
||||
|
||||
const days = Math.floor(timeRemaining / (1000 * 60 * 60 * 24));
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user