import dayjs, { type ConfigType } from 'dayjs' import utc from 'dayjs/plugin/utc' import relativeTime from 'dayjs/plugin/relativeTime' dayjs.extend(utc) dayjs.extend(relativeTime) export const isAfter = (date: ConfigType, compare: ConfigType) => { return dayjs(date).isAfter(dayjs(compare)) } export const formatTime = ({ date, dateFormat }: { date: ConfigType; dateFormat: string }) => { return dayjs(date).format(dateFormat) } export const formatDistanceToNow = (date: ConfigType) => { return dayjs(date).fromNow() }