2023-09-23 00:33:48 +08:00
|
|
|
import dayjs from 'dayjs'
|
2023-09-23 01:38:36 +08:00
|
|
|
import { locale } from '~/i18n'
|
2023-09-23 00:33:48 +08:00
|
|
|
|
|
|
|
export const formatTimeFromNow = (time: number | string) =>
|
2023-09-23 01:38:36 +08:00
|
|
|
dayjs(time).locale(locale()).fromNow()
|