Fix dayjs fromNow bug (it requires plugin, so use our util instead)

This commit is contained in:
James Grugett 2022-08-31 15:35:34 -05:00
parent d06b725f52
commit 83696cca21

View File

@ -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>
)
}