manifold/web/lib/util/time.ts

8 lines
180 B
TypeScript
Raw Normal View History

import dayjs from 'dayjs'
import relativeTime from 'dayjs/plugin/relativeTime'
dayjs.extend(relativeTime)
export function fromNow(time: number) {
return dayjs(time).fromNow()
}