/** * Format a date to a localized date string * @param date - Date object or ISO string * @returns Formatted date string (e.g., "Jan 15, 2025") */ export function formatDate(date: Date | string | undefined): string { if (!date) return "N/A"; const dateObj = typeof date === "string" ? new Date(date) : date; try { return new Intl.DateTimeFormat("en-US", { month: "short", day: "numeric", year: "numeric", }).format(dateObj); } catch (error) { console.error("Error formatting date:", error); return "Invalid Date"; } }