time.ts 356 B

12345678910111213
  1. import dayjs, { type ConfigType } from 'dayjs'
  2. import utc from 'dayjs/plugin/utc'
  3. dayjs.extend(utc)
  4. export const isAfter = (date: ConfigType, compare: ConfigType) => {
  5. return dayjs(date).isAfter(dayjs(compare))
  6. }
  7. export const formatTime = ({ date, dateFormat }: { date: ConfigType; dateFormat: string }) => {
  8. return dayjs(date).format(dateFormat)
  9. }