shellphone.app/app/blog/components/date.tsx
2021-08-28 00:08:38 +08:00

11 lines
274 B
TypeScript

const formatter = Intl.DateTimeFormat("en-US", {
day: "2-digit",
month: "short",
year: "numeric",
});
export default function DateComponent({ dateString }: any) {
const date = new Date(dateString);
return <time dateTime={dateString}>{formatter.format(date)}</time>;
}