el.xwx.moe/components/LinkViews/LinkComponents/LinkDate.tsx
2024-04-27 12:23:33 -04:00

24 lines
560 B
TypeScript

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