2024-12-09 11:46:18 +08:00
|
|
|
import dayjs, { type ConfigType } from 'dayjs'
|
2024-12-12 14:45:00 +08:00
|
|
|
import utc from 'dayjs/plugin/utc'
|
|
|
|
|
|
|
|
dayjs.extend(utc)
|
2024-12-09 11:46:18 +08:00
|
|
|
|
|
|
|
export const isAfter = (date: ConfigType, compare: ConfigType) => {
|
|
|
|
return dayjs(date).isAfter(dayjs(compare))
|
|
|
|
}
|
2024-12-12 14:45:00 +08:00
|
|
|
|
|
|
|
export const formatTime = ({ date, dateFormat }: { date: ConfigType; dateFormat: string }) => {
|
|
|
|
return dayjs(date).format(dateFormat)
|
|
|
|
}
|