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 { DateTimeTooltip } from './datetime-tooltip'
|
||||||
import dayjs from 'dayjs'
|
|
||||||
import React from 'react'
|
import React from 'react'
|
||||||
|
import { fromNow } from 'web/lib/util/time'
|
||||||
|
|
||||||
export function RelativeTimestamp(props: { time: number }) {
|
export function RelativeTimestamp(props: { time: number }) {
|
||||||
const { time } = props
|
const { time } = props
|
||||||
const dayJsTime = dayjs(time)
|
|
||||||
return (
|
return (
|
||||||
<DateTimeTooltip
|
<DateTimeTooltip
|
||||||
className="ml-1 whitespace-nowrap text-gray-400"
|
className="ml-1 whitespace-nowrap text-gray-400"
|
||||||
time={time}
|
time={time}
|
||||||
>
|
>
|
||||||
{dayJsTime.fromNow()}
|
{fromNow(time)}
|
||||||
</DateTimeTooltip>
|
</DateTimeTooltip>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user