8 lines
180 B
TypeScript
8 lines
180 B
TypeScript
|
import dayjs from 'dayjs'
|
||
|
import relativeTime from 'dayjs/plugin/relativeTime'
|
||
|
dayjs.extend(relativeTime)
|
||
|
|
||
|
export function fromNow(time: number) {
|
||
|
return dayjs(time).fromNow()
|
||
|
}
|