-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Also format automatically my birth date. Will be usefull when CV will be dispayed in French too.
- Loading branch information
1 parent
7884973
commit 209777f
Showing
2 changed files
with
14 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,6 +21,18 @@ export const metadata: Metadata = { | |
*/ | ||
|
||
export default function Cv() { | ||
const birthDate = new Date(1982, 2, 28); | ||
const now = new Date(); | ||
const age = now.getFullYear() - birthDate.getFullYear(); | ||
|
||
const birthdateFormat: Intl.DateTimeFormatOptions = { | ||
year: 'numeric', | ||
month: 'long', | ||
day: 'numeric', | ||
}; | ||
|
||
const formattedBirthDate = new Intl.DateTimeFormat('en-US', birthdateFormat).format(birthDate); | ||
|
||
return ( | ||
<div className={styles.main}> | ||
<div className={styles.container}> | ||
|
@@ -32,7 +44,7 @@ export default function Cv() { | |
{ title: 'Phone', value: { main: '+33 6 20 45 25 55' } }, | ||
{ title: 'Email', value: { main: '[email protected]' } }, | ||
{ title: 'Nationality', value: { main: 'French' } }, | ||
{ title: 'Date of birth', value: { main: 'March 28, 1982 (42 years old)' } }, | ||
{ title: 'Date of birth', value: { main: formattedBirthDate + ' (' + age + ' years old)' } }, | ||
]} | ||
/> | ||
<Section | ||
|