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
c41fa938ff
commit
d6693d2c60
1 changed files with 11 additions and 1 deletions
|
|
@ -227,7 +227,7 @@ function VideoCard({
|
|||
onChannelFilter?: (channelId: string, channelName: string) => void;
|
||||
onOpen?: (v: Video, startAt?: number | null) => void;
|
||||
}) {
|
||||
const { t } = useTranslation();
|
||||
const { t, i18n } = useTranslation();
|
||||
const watched = video.status === "watched";
|
||||
const meta = (
|
||||
<>
|
||||
|
|
@ -240,6 +240,16 @@ function VideoCard({
|
|||
</>
|
||||
)}
|
||||
{relativeTime(video.published_at)}
|
||||
{video.published_at && (
|
||||
<>
|
||||
{" · "}
|
||||
{new Date(video.published_at).toLocaleDateString(i18n.language, {
|
||||
year: "numeric",
|
||||
month: "short",
|
||||
day: "numeric",
|
||||
})}
|
||||
</>
|
||||
)}
|
||||
</>
|
||||
);
|
||||
const title = (
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue