From 3104251c9e96fcb2ac5ce9e0eaad99106f299015 Mon Sep 17 00:00:00 2001 From: thomasRalee Date: Thu, 1 Aug 2024 01:10:30 +0800 Subject: [PATCH] chore: remove duplicated sharedGetDuration function --- layer/utils/formatter.ts | 28 +++------------------------- 1 file changed, 3 insertions(+), 25 deletions(-) diff --git a/layer/utils/formatter.ts b/layer/utils/formatter.ts index f1693e8..b189312 100644 --- a/layer/utils/formatter.ts +++ b/layer/utils/formatter.ts @@ -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 } @@ -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; -}