Skip to content

Commit

Permalink
Calculate age
Browse files Browse the repository at this point in the history
  • Loading branch information
adamplesnik committed Sep 30, 2024
1 parent ff540b2 commit bb3c369
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/content/Cv.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,22 @@ import FlowerAnim from '../components/FlowerAnim'
import Heading from '../components/Heading'
import Paragraph from '../components/Paragraph'

const MyAge = () => {
const myBirth = new Date('1985-06-22T12:00Z').getTime()
const now = new Date().getTime()
const myAge = (now - myBirth) / 1000 / 60 / 60 / 24 / 365.25
return Math.floor(myAge)
}

const Cv = () => {
return (
<div>
<Heading size={3}>About me</Heading>
<div className="flex items-center gap-2">
<div className="order-last sm:order-none">
<Paragraph>Married, 38 years old, father of two girls.</Paragraph>
<Paragraph>
Married, <MyAge /> years old, father of two girls.
</Paragraph>
</div>
<FlowerAnim />
</div>
Expand Down

0 comments on commit bb3c369

Please sign in to comment.