import moment from "moment";
const getShortDateFormat = value => {
  return value.replace(/Y|,$/gi, "").trim();
};
export const formatDate = function (value, format, long) {
  if (format === void 0) {
    format = "YYYY-MM-DD";
  }
  if (long === void 0) {
    long = true;
  }
  if (typeof value === "undefined") {
    return "";
  }
  let date;
  let year;
  if (typeof value === "number") {
    date = moment.unix(value);
    year = moment().utc().year();
  } else {
    date = moment(value);
    year = moment().year();
  }
  if (!long) {
    if (date.year() === year) {
      return date.format(getShortDateFormat(format));
    }
  }
  return date.format(format);
};
//# sourceMappingURL=dateUtils.js.map