Skip to content

Commit

Permalink
show date property correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
matthias-luger committed Jul 27, 2024
1 parent 108734a commit 5043798
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions components/AuctionDetails/AuctionDetails.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,11 @@ function AuctionDetails(props: Props) {
)
}

if (key === 'date') {
let date = new Date(parseInt(value))
return date.toLocaleDateString() + ' ' + date.toLocaleTimeString()
}

// Don't use the number formating if it includes a 'e' as it is then treated as an exponential number resulting in displaying "∞"
if (!isNaN(value) && !value.toString().includes('e')) {
return <Number number={value} />
Expand Down

0 comments on commit 5043798

Please sign in to comment.