Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

time.ts 356B

123456789101112
  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. }