portfolio/lib/formatDate.ts

9 lines
232 B
TypeScript

export function formatDate(dateString: string) {
return new Date(`${dateString}T00:00:00Z`).toLocaleDateString('en-IE', {
day: 'numeric',
month: 'long',
year: 'numeric',
timeZone: 'UTC',
})
}