From 83a8ab0161ba2638e2da704231a5d30a7ad95d2d Mon Sep 17 00:00:00 2001 From: ogous Date: Thu, 30 Jan 2025 12:24:44 +0300 Subject: [PATCH] handle zero timestamp for concluded infra markets --- web/src/utils/calcTimeDiff.ts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/web/src/utils/calcTimeDiff.ts b/web/src/utils/calcTimeDiff.ts index b34c84e..6e7b39a 100644 --- a/web/src/utils/calcTimeDiff.ts +++ b/web/src/utils/calcTimeDiff.ts @@ -10,6 +10,15 @@ export function calcTimeLeft(endTime: number) { } else if (endTime.toString().length === 10) { // if endTime in seconds endTimeInMs = endTime * 1000; + } else if (endTime === 0) { + return { + full: "End date is already due.", + short: "End date is already due.", + days: 0, + hours: 0, + minutes: 0, + seconds: 0, + }; } else { return { full: "Invalid timestamp",