Fix client detail customer identity
All checks were successful
Build and Deploy / build-and-deploy (push) Successful in 1m17s
All checks were successful
Build and Deploy / build-and-deploy (push) Successful in 1m17s
This commit is contained in:
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user