From c3c3fd4bafc50af837743ea43d7db7944152511f Mon Sep 17 00:00:00 2001 From: Jack Merrill Date: Thu, 15 Apr 2021 13:09:36 -0500 Subject: [PATCH] feat: add age to website --- pages/index.tsx | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/pages/index.tsx b/pages/index.tsx index 6be26cd..89a414d 100644 --- a/pages/index.tsx +++ b/pages/index.tsx @@ -27,6 +27,12 @@ const IndexPage = () => { } }) + function calculateAge() { + var ageDifMs = Date.now() - new Date('July 13, 2004').getTime(); + var ageDate = new Date(ageDifMs); + return Math.abs(ageDate.getUTCFullYear() - 1970); + } + return ( <> @@ -37,7 +43,7 @@ const IndexPage = () => {

Good {timeString}! I'm Jack Merrill.

-

A Graphic and UI Designer and Fullstack Developer from the Windy City.

+

A {calculateAge()} year old Graphic and UI Designer and Fullstack Developer from the Windy City.

@@ -60,7 +66,7 @@ const IndexPage = () => {

- I'm Jack, a Graphic/UI Designer and Fullstack Developer from Chicago. Since I started + I'm Jack, a {calculateAge()} year old Graphic/UI Designer and Fullstack Developer from Chicago. Since I started programming in 2014, I've used Python, NodeJS, HTML and CSS. Nowadays, I prefer to use NextJS, TailwindCSS, and NodeJS. Being a fullstack developer, I've had to create numerous logos and brands for various projects of mine.