From 9f07a7e59f22a3579de8ac9b9d1e391ca6a99cc6 Mon Sep 17 00:00:00 2001 From: FURK4NGG <105324908+FURK4NGG@users.noreply.github.com> Date: Tue, 18 Feb 2025 17:05:17 +0300 Subject: [PATCH] Update 1.js --- JAVASCRIPT/1.js | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/JAVASCRIPT/1.js b/JAVASCRIPT/1.js index 0448fbd..f81e89a 100644 --- a/JAVASCRIPT/1.js +++ b/JAVASCRIPT/1.js @@ -44,11 +44,18 @@ images[currentIndex].classList.add('visible'); /*GET TIME*/ async function getCurrentYear() { - return new Date().getFullYear(); + const now = new Date(); + const currentYear = now.getFullYear(); + const currentMonth = now.getMonth() + 1; + + let age = currentYear - 2006; + + if(currentMonth < 3){age -= 1;} + return age; } -getCurrentYear().then(year => { - const text1 = `an ${year - 2006} years old`; +getCurrentYear().then(age => { + const text1 = `an ${age} years old`; const text2 = `I am ${text1} university student studying Computer Engineering. Since 2020, I have mostly improved myself in back-end departments, particularly in Robotic Coding, Mobile Application Development, 2D/3D Game Development, Website Creation, Cyber Security, and AI Prompt Engineering. I have also participated in Teknofest Competitions and TUBITAK projects. Right now, I am working on projects related to AI and IoT. I am passionate about creating innovative solutions that can positively impact people’s lives and contribute to society, and I am always open to exploring new ideas that serve humanity.`;