Fix TypeScript compilation errors across components, selectors, and profile module
This commit is contained in:
@@ -51,9 +51,13 @@ const parseDDMMYYYY = (str: string | undefined): Date | null => {
|
||||
if (!str) return null;
|
||||
const parts = str.split('/');
|
||||
if (parts.length !== 3) return null;
|
||||
const d = parseInt(parts[0], 10);
|
||||
const m = parseInt(parts[1], 10) - 1;
|
||||
const y = parseInt(parts[2], 10);
|
||||
const part0 = parts[0];
|
||||
const part1 = parts[1];
|
||||
const part2 = parts[2];
|
||||
if (!part0 || !part1 || !part2) return null;
|
||||
const d = parseInt(part0, 10);
|
||||
const m = parseInt(part1, 10) - 1;
|
||||
const y = parseInt(part2, 10);
|
||||
if (isNaN(d) || isNaN(m) || isNaN(y)) return null;
|
||||
return new Date(y, m, d);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user