mirror of
https://github.com/hanzoai/next.js.git
synced 2026-09-24 17:00:51 +00:00
11 lines
256 B
TypeScript
11 lines
256 B
TypeScript
import { parseISO, format } from "date-fns";
|
|
|
|
type Props = {
|
|
dateString: string;
|
|
};
|
|
|
|
export default function Date({ dateString }: Props) {
|
|
const date = parseISO(dateString);
|
|
return <time dateTime={dateString}>{format(date, "LLLL d, yyyy")}</time>;
|
|
}
|