fix: use date-fns functional programming module
This commit is contained in:
parent
b0a031bd97
commit
ca2274a8a2
20 changed files with 94 additions and 103 deletions
|
|
@ -1,6 +1,6 @@
|
|||
import { useQuery } from '@apollo/react-hooks'
|
||||
import { makeStyles } from '@material-ui/core'
|
||||
import { formatDistanceToNow } from 'date-fns'
|
||||
import { formatDistance } from 'date-fns'
|
||||
import gql from 'graphql-tag'
|
||||
import * as R from 'ramda'
|
||||
import React from 'react'
|
||||
|
|
@ -91,7 +91,9 @@ const MachineStatus = () => {
|
|||
textAlign: 'left',
|
||||
view: m =>
|
||||
m.lastPing
|
||||
? formatDistanceToNow(new Date(m.lastPing), { addSuffix: true })
|
||||
? formatDistance(new Date(m.lastPing), new Date(), {
|
||||
addSuffix: true
|
||||
})
|
||||
: 'unknown'
|
||||
},
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue