import dayjs from 'dayjs';

export * from './createExtraWrapper';

// Date to Dayjs，弥补 el 默认输出 Date 格式的问题
export const d2D = (date: Date | null, format?: string) => {
  if (date) {
    // @ts-ignore
    date = dayjs(date);
    if (format)
      // @ts-ignore
      date = date.format(format);
  }
  return date;
};
