From f16be31be4b46a727a94bec58c9429594f70c7c6 Mon Sep 17 00:00:00 2001 From: Lechner Julian Date: Mon, 17 Mar 2025 11:52:14 +0100 Subject: [PATCH] Changed Birthday Calculation --- Resources/Javascript.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Resources/Javascript.js b/Resources/Javascript.js index 1c9a1cf..074103f 100644 --- a/Resources/Javascript.js +++ b/Resources/Javascript.js @@ -44,11 +44,11 @@ function ReplacePlaceholders() { } function ReplaceAgePlaceholder() { - let birthDate = new Date(_birthdayDate); - let diffTime = Math.abs(_todayDate - birthDate); - let diffTimeInYearsCalculation = diffTime / (1000 * 60 * 60 * 24 * 365.25); - let tempAge = diffTimeInYearsCalculation.toFixed(1) - let age = tempAge % 1 === 0 ? diffTimeInYearsCalculation.toFixed(0) : diffTimeInYearsCalculation.toFixed(1); + let birthDate = new Date("3-3-2009"); + let diffTimeInMilliseconds = new Date() - birthDate; + let diffTimeInYears = diffTimeInMilliseconds / (1000 * 60 * 60 * 24 * 365.25); + let tempAge = diffTimeInYears.toFixed(1); + let age = tempAge % 1 === 0 ? Math.round(diffTimeInYears) : tempAge; document.body.innerHTML = document.body.innerHTML.replace("%AGE%", age); }