Skip to content

Commit

Permalink
chore: remove duplicated sharedGetDuration function
Browse files Browse the repository at this point in the history
  • Loading branch information
ThomasRalee committed Jul 31, 2024
1 parent 462f461 commit 3104251
Showing 1 changed file with 3 additions and 25 deletions.
28 changes: 3 additions & 25 deletions layer/utils/formatter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -158,9 +158,9 @@ export const sharedGetTensMultiplier = (number: number | string): number => {
export const sharedEllipsisFormatText = (text: string, length = 20): string => {
return text.length > length
? `${text.slice(0, length)}...${text.slice(
text.length - length,
text.length
)}`
text.length - length,
text.length
)}`
: text
}

Expand All @@ -175,25 +175,3 @@ export const sharedCoinStringToCoins = (coinString: string): Coin[] => {
}
})
}



export const sharedGetDuration = ({
endDateInMilliseconds,
nowInMilliseconds
}: {
endDateInMilliseconds: string
nowInMilliseconds: string
}) => {
const end = new BigNumberInBase(endDateInMilliseconds)
const now = new BigNumberInBase(nowInMilliseconds)

const startInMilliseconds = now.isGreaterThan(end) ? end : now

const duration = intervalToDuration({
start: startInMilliseconds.toNumber(),
end: end.toNumber()
})

return duration;
}

0 comments on commit 3104251

Please sign in to comment.