feat: remove all instances of moment usage
This commit is contained in:
parent
7d6fb17158
commit
973040f409
29 changed files with 252 additions and 193 deletions
|
|
@ -1,6 +1,6 @@
|
|||
import { makeStyles } from '@material-ui/core/styles'
|
||||
import BigNumber from 'bignumber.js'
|
||||
import moment from 'moment'
|
||||
import { differenceInSeconds } from 'date-fns'
|
||||
import React from 'react'
|
||||
|
||||
import { Status } from 'src/components/Status'
|
||||
|
|
@ -13,8 +13,7 @@ const useStyles = makeStyles(styles)
|
|||
|
||||
const makeLastPing = lastPing => {
|
||||
if (!lastPing) return null
|
||||
const now = moment()
|
||||
const secondsAgo = now.diff(lastPing, 'seconds')
|
||||
const secondsAgo = differenceInSeconds(new Date(), lastPing)
|
||||
if (secondsAgo < 60) {
|
||||
return `${secondsAgo} ${secondsAgo === 1 ? 'second' : 'seconds'} ago`
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue