mirror of
https://github.com/fergalmoran/supanextail.git
synced 2025-12-22 09:17:54 +00:00
13 lines
308 B
TypeScript
13 lines
308 B
TypeScript
import { format, parseISO } from 'date-fns';
|
|
|
|
type Properties = {
|
|
dateString: string;
|
|
};
|
|
|
|
const DateFormatter = ({ dateString }: Properties): JSX.Element => {
|
|
const date = parseISO(dateString);
|
|
return <time dateTime={dateString}>{format(date, 'LLLL d, yyyy')}</time>;
|
|
};
|
|
|
|
export default DateFormatter;
|