actually make this display the accurate age
This commit is contained in:
parent
ee665ea86d
commit
2db7c6a96a
1 changed files with 4 additions and 3 deletions
|
@ -50,7 +50,8 @@ for (question of questions) {
|
||||||
$('#about-list').html(a);
|
$('#about-list').html(a);
|
||||||
|
|
||||||
function getAge() {
|
function getAge() {
|
||||||
let birthdate = new Date("1999-05-21");
|
let birthdayMillis = Date.UTC(1999, 05, 21);
|
||||||
let age = new Date(Date.now()).getUTCFullYear() - birthdate.getUTCFullYear();
|
let todayMillis = Date.now();
|
||||||
return age;
|
let ageSinceStart = new Date(todayMillis - birthdayMillis);
|
||||||
|
return ageSinceStart.getUTCFullYear() - 1970;
|
||||||
}
|
}
|
Loading…
Reference in a new issue