1
1
mirror of https://github.com/theoludwig/theoludwig.git synced 2025-05-29 22:37:44 +02:00

feat: display age nearby the birth date

This commit is contained in:
Divlo
2022-03-24 11:45:19 +01:00
parent 1152039663
commit a67d6665ea
13 changed files with 3273 additions and 4867 deletions

View File

@ -1,4 +1,9 @@
export const DIVLO_BIRTHDAY = new Date('2003-03-31')
export const DIVLO_BIRTHDAY_DAY = '31'
export const DIVLO_BIRTHDAY_MONTH = '03'
export const DIVLO_BIRTHDAY_YEAR = '2003'
export const DIVLO_BIRTHDAY = new Date(
`${DIVLO_BIRTHDAY_YEAR}-${DIVLO_BIRTHDAY_MONTH}-${DIVLO_BIRTHDAY_DAY}`
)
/**
* Calculates the age of a person based on their birth date

View File

@ -1,6 +1,3 @@
import { DIVLO_BIRTHDAY, getAge } from './getAge'
export const getDefaultDescription = (): string => {
const age = getAge(DIVLO_BIRTHDAY)
export const getDefaultDescription = (age: number): string => {
return `I'm Divlo, I'm ${age} years old, I'm from France - Developer Full Stack Junior • Passionate about High-Tech`
}