Fix client detail customer identity
All checks were successful
Build and Deploy / build-and-deploy (push) Successful in 1m17s

This commit is contained in:
Cauê Faleiros
2026-06-18 16:31:22 -03:00
parent 1af624aa77
commit c35f8f8a51
8 changed files with 173 additions and 36 deletions

View File

@@ -258,23 +258,6 @@ export const deleteUser = async (id: number): Promise<void> => {
}
};
export const parseOrderDate = (dateStr: string): Date => {
if (!dateStr) return new Date(0);
if (dateStr.includes('T')) return new Date(dateStr);
const parts = dateStr.split(/[-/]/);
if (parts.length === 3) {
if (parts[0].length === 4) {
// YYYY-MM-DD
return new Date(Number(parts[0]), Number(parts[1]) - 1, Number(parts[2]));
} else {
// DD-MM-YYYY
return new Date(Number(parts[2]), Number(parts[1]) - 1, Number(parts[0]));
}
}
const fallback = new Date(dateStr);
return isNaN(fallback.getTime()) ? new Date(0) : fallback;
};
export const exportToCSV = (data: Record<string, unknown>[], filename: string) => {
if (!data || !data.length) return;