Skip to content

Commit

Permalink
fix: expiration date lands (#113)
Browse files Browse the repository at this point in the history
Fix expiration date calculation
  • Loading branch information
Melisa Anabella Rossi authored Nov 23, 2023
1 parent 53dd32d commit 0b9e6d0
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/modules/api/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,11 @@ import {
import proximities from './data/proximity.json'

export function isExpired(order: OrderFragment) {
return parseInt(order.expiresAt) <= Math.round(Date.now() / 1000)
const expirationDate =
order.expiresAt.length === 10
? parseInt(order.expiresAt, 10)
: Math.round(parseInt(order.expiresAt, 10) / 1000)
return expirationDate <= Math.round(Date.now() / 1000)
}

export const getProximity = (
Expand Down

0 comments on commit 0b9e6d0

Please sign in to comment.