portfolio/lib/formatDate.ts

9 lines
232 B
TypeScript
Raw Normal View History

2023-01-14 22:25:11 +00:00
export function formatDate(dateString: string) {
2022-12-06 12:54:34 +00:00
return new Date(`${dateString}T00:00:00Z`).toLocaleDateString('en-IE', {
day: 'numeric',
month: 'long',
year: 'numeric',
timeZone: 'UTC',
})
}