el.xwx.moe/components/LinkViews/LinkComponents/LinkDate.tsx
2023-12-17 16:30:09 +08:00

23 lines
539 B
TypeScript

import { LinkIncludingShortenedCollectionAndTags } from "@/types/global";
import React from "react";
export default function LinkDate({ link }: {
link: LinkIncludingShortenedCollectionAndTags;
}) {
const formattedDate = new Date(link.createdAt as string).toLocaleString(
"en-US",
{
year: "numeric",
month: "short",
day: "numeric",
},
);
return (
<div className="flex items-center gap-1 text-neutral">
<i className="bi-calendar3 text-lg"></i>
<p>{formattedDate}</p>
</div>
);
}