feat(card): show the exact upload date inline after the relative time

There's room on the meta line, so append the precise date (locale-aware, e.g. '12 Jan
2017') after '9 yr ago' instead of hiding it in a tooltip.
This commit is contained in:
npeter83 2026-06-16 03:04:50 +02:00
parent 48e7f8d11e
commit 71d7440a8b

View file

@ -227,7 +227,7 @@ function VideoCard({
onChannelFilter?: (channelId: string, channelName: string) => void; onChannelFilter?: (channelId: string, channelName: string) => void;
onOpen?: (v: Video, startAt?: number | null) => void; onOpen?: (v: Video, startAt?: number | null) => void;
}) { }) {
const { t } = useTranslation(); const { t, i18n } = useTranslation();
const watched = video.status === "watched"; const watched = video.status === "watched";
const meta = ( const meta = (
<> <>
@ -240,6 +240,16 @@ function VideoCard({
</> </>
)} )}
{relativeTime(video.published_at)} {relativeTime(video.published_at)}
{video.published_at && (
<>
{" · "}
{new Date(video.published_at).toLocaleDateString(i18n.language, {
year: "numeric",
month: "short",
day: "numeric",
})}
</>
)}
</> </>
); );
const title = ( const title = (