el.xwx.moe/components/LinkViews/LinkComponents/LinkDate.tsx

25 lines
541 B
TypeScript
Raw Normal View History

2023-12-15 21:25:39 -06:00
import { LinkIncludingShortenedCollectionAndTags } from "@/types/global";
2023-12-17 02:30:09 -06:00
import React from "react";
2023-12-15 21:25:39 -06:00
2023-12-29 11:21:22 -06:00
export default function LinkDate({
link,
}: {
2023-12-15 21:25:39 -06:00
link: LinkIncludingShortenedCollectionAndTags;
}) {
const formattedDate = new Date(link.createdAt as string).toLocaleString(
"en-US",
{
year: "numeric",
month: "short",
day: "numeric",
2023-12-29 11:21:22 -06:00
}
2023-12-15 21:25:39 -06:00
);
return (
<div className="flex items-center gap-1 text-neutral">
2023-12-17 02:30:09 -06:00
<i className="bi-calendar3 text-lg"></i>
2023-12-15 21:25:39 -06:00
<p>{formattedDate}</p>
</div>
);
}