Fix dayjs fromNow bug (it requires plugin, so use our util instead)
This commit is contained in:
parent
d06b725f52
commit
83696cca21
|
@ -1,16 +1,15 @@
|
|||
import { DateTimeTooltip } from './datetime-tooltip'
|
||||
import dayjs from 'dayjs'
|
||||
import React from 'react'
|
||||
import { fromNow } from 'web/lib/util/time'
|
||||
|
||||
export function RelativeTimestamp(props: { time: number }) {
|
||||
const { time } = props
|
||||
const dayJsTime = dayjs(time)
|
||||
return (
|
||||
<DateTimeTooltip
|
||||
className="ml-1 whitespace-nowrap text-gray-400"
|
||||
time={time}
|
||||
>
|
||||
{dayJsTime.fromNow()}
|
||||
{fromNow(time)}
|
||||
</DateTimeTooltip>
|
||||
)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user