Changing the structure and fixing spelling errors
Some checks failed
Build lyes.eu / build (push) Failing after 13m24s
Build lyes.eu / deploy (push) Has been skipped

This commit is contained in:
Lyes Saadi 2026-03-07 14:13:26 +01:00
parent 9071e1de08
commit a4368a38ad
Signed by: lyes
GPG key ID: 55A1D803917CF39A
8 changed files with 176 additions and 175 deletions

25
static/index/index.js Normal file
View file

@ -0,0 +1,25 @@
// Source - https://stackoverflow.com/questions/4076321/javascript-age-calculation
// Posted by Matt
// Retrieved 2025-11-22, License - CC BY-SA 2.5
function calculateAge(birthDate, otherDate) {
var years = (otherDate.getFullYear() - birthDate.getFullYear());
if (otherDate.getMonth() < birthDate.getMonth() ||
otherDate.getMonth() == birthDate.getMonth() && otherDate.getDate() < birthDate.getDate()) {
years--;
}
return years;
}
function lyesAge() {
let birth = new Date("2002-04-18")
let today = new Date()
return calculateAge(birth, today)
}
function changeAge() {
document.getElementById("age").innerHTML = lyesAge()
}
changeAge()