From 5043798ace636a5992b6295328f6fbe63da319f5 Mon Sep 17 00:00:00 2001 From: Matthias Luger Date: Sat, 27 Jul 2024 11:27:58 +0200 Subject: [PATCH] show date property correctly --- components/AuctionDetails/AuctionDetails.tsx | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/components/AuctionDetails/AuctionDetails.tsx b/components/AuctionDetails/AuctionDetails.tsx index 01e7706f..b2e88fad 100644 --- a/components/AuctionDetails/AuctionDetails.tsx +++ b/components/AuctionDetails/AuctionDetails.tsx @@ -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