Skip to content

Commit

Permalink
Merge pull request #328 from Etherna/fix/EDD-407-publish-time
Browse files Browse the repository at this point in the history
fix publish date when createdAt is 0
  • Loading branch information
mattiaz9 authored Mar 3, 2024
2 parents 138d15a + 464041e commit cb29eef
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/components/video/VideoPreview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -194,11 +194,11 @@ const VideoPreview: React.FC<VideoPreviewProps> = ({
</div>
</Link>
)}
{video.preview.createdAt && (
<div className="text-xs text-gray-600 dark:text-gray-500">
{dayjs.duration(dayjs(video.preview.createdAt).diff(dayjs())).humanize(true)}
</div>
)}
<div className="text-xs text-gray-600 dark:text-gray-500">
{video.preview.createdAt
? dayjs.duration(dayjs(video.preview.createdAt).diff(dayjs())).humanize(true)
: "unknown publish date"}
</div>
<div className={cn("mt-2 grid auto-cols-max grid-flow-col gap-3 empty:mt-0")}>
{isVideoOffered && (
<Badge prefix={<CreditIcon width={16} aria-hidden />} color="primary" small>
Expand Down

0 comments on commit cb29eef

Please # to comment.