File size: 298 Bytes
1e92f2d
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
import { parseISO, format } from "date-fns";

export default function DateFormatter({ dateString }) {
  if (!dateString) {
    return null;
  }
  const date = parseISO(dateString);
  const formattedDate = format(date, "LLLL	d, yyyy");
  return <time dateTime={dateString}>{formattedDate}</time>;
}