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:
parent
48e7f8d11e
commit
71d7440a8b
1 changed files with 11 additions and 1 deletions
|
|
@ -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 = (
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue