Skip to content

Commit

Permalink
Fix relative time
Browse files Browse the repository at this point in the history
  • Loading branch information
cawabunga committed Sep 16, 2024
1 parent 456fdd7 commit 32d3263
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ <h1>Puffer VT price change</h1>

for (const {timestamp, event} of entries) {
const date = new Date(timestamp * 1000)
const relativeDate = rtf1.format(Math.floor((date - now) / (24 * 60 * 60 * 1000)), 'days')
const relativeDate = rtf1.format(Math.ceil((date - now) / (24 * 60 * 60 * 1000)), 'days')
const diff = event.newPrice - event.oldPrice
const diffPercentage = (diff / event.oldPrice) * 100
const priceInEth = formatBn(BigInt(event.newPrice), 18)
Expand Down

0 comments on commit 32d3263

Please sign in to comment.