import moment from "moment";
export function formatDate(date, format) {
  if (!date) return '';

  const formatFunc = date => date === null || date === void 0 ? void 0 : date.format(format);

  if (Array.isArray(date)) {
    return date.map(e => formatFunc(e));
  } else {
    return formatFunc(date);
  }
}
export function toMoment(date, format) {
  if (!date) return null;

  const formatFunc = date => moment(date, format);

  if (Array.isArray(date)) {
    return date.map(e => formatFunc(e));
  } else {
    return formatFunc(date);
  }
}