import dayjs, { Dayjs } from 'dayjs';

const DATE_TIME_FORMAT = 'YYYY-MM-DD HH:mm';
const DATE_FORMAT = 'YYYY-MM-DD';

export function formatToDateTime(date, format = DATE_TIME_FORMAT): Dayjs {
  return dayjs(date, format);
}

export function formatToDate(date, format = DATE_FORMAT): Dayjs {
  return dayjs(date, format);
}

export const dateUtil = dayjs;
