Files
Your NamebaishaliHolocron b9ac5ae0b2 first commit
2026-06-15 12:57:03 +05:30

15 lines
425 B
TypeScript

export function formatDate(inputDate: string | null | undefined): string {
if (!inputDate) return "";
const date = new Date(inputDate);
const day = String(date.getDate()).padStart(2, "0");
const monthNames = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"];
const month = monthNames[date.getMonth()];
const year = date.getFullYear();
return `${day}-${month}-${year}`;
}