personal-website/lib/formatDate.ts
Filipe Medeiros 9a9638237f
feat: initial commit
Signed-off-by: Filipe Medeiros <hello@filipesm.eu>
2023-12-03 12:25:52 +01:00

11 lines
225 B
TypeScript

const formatDate = (dateString: string) => {
return new Date(`${dateString}`).toLocaleDateString('pt-PT', {
day: 'numeric',
month: 'long',
year: 'numeric',
timeZone: 'UTC',
})
}
export default formatDate