function toDate(value) {
  if (!value) return null;
  const iso = value.includes("T") ? value : value.replace(" ", "T") + "Z";
  const d = new Date(iso);
  return isNaN(d.getTime()) ? null : d;
}
function formatDate(value) {
  const d = toDate(value);
  if (!d) return "—";
  return d.toLocaleDateString("es-ES", { day: "2-digit", month: "short", year: "numeric" });
}
function formatDateTime(value) {
  const d = toDate(value);
  if (!d) return "—";
  return d.toLocaleString("es-ES", {
    day: "2-digit",
    month: "short",
    year: "numeric",
    hour: "2-digit",
    minute: "2-digit"
  });
}
function isOverdue(dueAt, returnedAt) {
  if (returnedAt || !dueAt) return false;
  const d = toDate(dueAt);
  return d ? d.getTime() < Date.now() : false;
}

export { formatDateTime as a, formatDate as f, isOverdue as i };
//# sourceMappingURL=format.js-B0aMHEZW.js.map
