mirror of
https://github.com/oceanprotocol/market.git
synced 2024-12-02 05:57:29 +01:00
Display the same string for timeout set to '1 month' (#798)
* same string displayed for 1 month * existing function updated and used
This commit is contained in:
parent
743ae02642
commit
e2bb8fc042
@ -42,6 +42,7 @@ export function secondsToString(numberOfSeconds: number): string {
|
|||||||
if (numberOfSeconds === 0) return 'Forever'
|
if (numberOfSeconds === 0) return 'Forever'
|
||||||
|
|
||||||
const years = Math.floor(numberOfSeconds / 31536000)
|
const years = Math.floor(numberOfSeconds / 31536000)
|
||||||
|
const months = Math.floor((numberOfSeconds %= 31536000) / 2630000)
|
||||||
const weeks = Math.floor((numberOfSeconds %= 31536000) / 604800)
|
const weeks = Math.floor((numberOfSeconds %= 31536000) / 604800)
|
||||||
const days = Math.floor((numberOfSeconds %= 604800) / 86400)
|
const days = Math.floor((numberOfSeconds %= 604800) / 86400)
|
||||||
const hours = Math.floor((numberOfSeconds %= 86400) / 3600)
|
const hours = Math.floor((numberOfSeconds %= 86400) / 3600)
|
||||||
@ -50,6 +51,8 @@ export function secondsToString(numberOfSeconds: number): string {
|
|||||||
|
|
||||||
return years
|
return years
|
||||||
? `${years} year${numberEnding(years)}`
|
? `${years} year${numberEnding(years)}`
|
||||||
|
: months
|
||||||
|
? `${months} month${numberEnding(months)}`
|
||||||
: weeks
|
: weeks
|
||||||
? `${weeks} week${numberEnding(weeks)}`
|
? `${weeks} week${numberEnding(weeks)}`
|
||||||
: days
|
: days
|
||||||
|
Loading…
x
Reference in New Issue
Block a user