import { f as format } from './index-e6b3332e.js';

function formatDate(timestamp, formatStr = "MMM do, yyyy") {
  if (!timestamp) {
    return false;
  }
  try {
    return format(typeof timestamp === "string"
      ? new Date(Date.parse(timestamp))
      : typeof timestamp === "object"
        ? (timestamp === null || timestamp === void 0 ? void 0 : timestamp.toDate)
          ? timestamp.toDate()
          : timestamp
        : parseInt(timestamp), formatStr);
  }
  catch (e) {
    console.log("Error formatting date", e);
  }
  return timestamp;
}

export { formatDate as f };
