Add: Formato DD-MM-YYYY para fechas de ingreso

This commit is contained in:
Santiago Lavaise
2026-04-13 12:04:57 -03:00
parent 8966c2f9b1
commit fcfa536b9d
5 changed files with 18 additions and 4 deletions
+10
View File
@@ -4,3 +4,13 @@ import { twMerge } from "tailwind-merge"
export function cn(...inputs: ClassValue[]) {
return twMerge(clsx(inputs))
}
export function formatDateDDMMYYYY(dateString: string): string {
if (!dateString) return '';
const date = new Date(dateString);
if (isNaN(date.getTime())) return dateString;
const day = String(date.getDate()).padStart(2, '0');
const month = String(date.getMonth() + 1).padStart(2, '0');
const year = date.getFullYear();
return `${day}-${month}-${year}`;
}