Skip to content

Commit

Permalink
handle zero timestamp for concluded infra markets
Browse files Browse the repository at this point in the history
  • Loading branch information
ogous committed Jan 30, 2025
1 parent 3c9928a commit 83a8ab0
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions web/src/utils/calcTimeDiff.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit 83a8ab0

Please sign in to comment.