1
0
mirror of https://github.com/oceanprotocol/market.git synced 2024-12-02 05:57:29 +01:00

fix Time when date is null

Signed-off-by: mihaisc <mihai.scarlat@smartcontrol.ro>
This commit is contained in:
mihaisc 2020-10-22 14:30:48 +03:00
parent ce6872d0bd
commit 034111b62d
No known key found for this signature in database
GPG Key ID: 4FB0C2329B4C6E29

View File

@ -13,7 +13,9 @@ export default function Time({
const dateNew = isUnix ? new Date(Number(date) * 1000) : new Date(date) const dateNew = isUnix ? new Date(Number(date) * 1000) : new Date(date)
const dateIso = dateNew.toISOString() const dateIso = dateNew.toISOString()
return ( return !date ? (
<></>
) : (
<time <time
title={relative ? format(dateNew, 'MMMM d, yyyy') : undefined} title={relative ? format(dateNew, 'MMMM d, yyyy') : undefined}
dateTime={dateIso} dateTime={dateIso}