From 076ca4bf6495360f837e0ecf069de2caaf24a713 Mon Sep 17 00:00:00 2001 From: Schalli Date: Mon, 21 Sep 2026 13:28:07 +0200 Subject: [PATCH] fix(web): Number.isNaN statt globalem isNaN in vier Date-Pruefungen, forEach-Rueckgabewert verworfen Alle vier Stellen (TenderDetail, ResultsList, InvoiceHistoryTable) rufen isNaN(d.getTime()) auf - Date.prototype.getTime() liefert immer number, also findet an keiner der vier Stellen tatsaechlich eine Umwandlung statt. Der Tausch auf Number.isNaN ist reine Haertung: sobald dort einmal ein String ankaeme, wuerde globales isNaN ihn stillschweigend umwandeln statt ihn als kaputte Eingabe zu erkennen. Kein Rueckfallwert geaendert. In cert-manager/actions.ts gibt files.forEach jetzt keinen Wert mehr aus der Schleifenfunktion heraus - forEach verwirft ihn ohnehin, die Aenderung ist rein kosmetisch (useIterableCallbackReturn). Reihenfolge der form.append-Aufrufe unveraendert. Quick-Vorgang 260921-i8x, Task 2/3. Co-Authored-By: Claude Sonnet 5 Claude-Session: https://claude.ai/code/session_01TPPB4ApQxzSU1rwV2Ffj9J --- apps/web/src/app/(portal)/modules/cert-manager/actions.ts | 4 +++- .../modules/dkv-fleet/components/InvoiceHistoryTable.tsx | 2 +- .../(portal)/modules/tender-radar/components/ResultsList.tsx | 2 +- .../(portal)/modules/tender-radar/components/TenderDetail.tsx | 4 ++-- 4 files changed, 7 insertions(+), 5 deletions(-) diff --git a/apps/web/src/app/(portal)/modules/cert-manager/actions.ts b/apps/web/src/app/(portal)/modules/cert-manager/actions.ts index 68195ba..6a475e0 100644 --- a/apps/web/src/app/(portal)/modules/cert-manager/actions.ts +++ b/apps/web/src/app/(portal)/modules/cert-manager/actions.ts @@ -151,7 +151,9 @@ export async function mergeCertsAction( password?: string, ): Promise { const form = new FormData(); - files.forEach((file) => form.append('files', file)); + files.forEach((file) => { + form.append('files', file); + }); form.append('outputFormat', outputFormat); if (password) form.append('password', password); return postForm('merge', form) as Promise; diff --git a/apps/web/src/app/(portal)/modules/dkv-fleet/components/InvoiceHistoryTable.tsx b/apps/web/src/app/(portal)/modules/dkv-fleet/components/InvoiceHistoryTable.tsx index 53da372..64bb148 100644 --- a/apps/web/src/app/(portal)/modules/dkv-fleet/components/InvoiceHistoryTable.tsx +++ b/apps/web/src/app/(portal)/modules/dkv-fleet/components/InvoiceHistoryTable.tsx @@ -30,7 +30,7 @@ function formatDateTime(isoString: string): string { // new Date() never throws — it returns an Invalid Date object for bad input. // Check explicitly so malformed strings fall back gracefully instead of // rendering as "NaN.NaN.NaN, NaN:NaN Uhr" (WR-03). - if (isNaN(d.getTime())) return isoString; + if (Number.isNaN(d.getTime())) return isoString; const day = String(d.getDate()).padStart(2, '0'); const month = String(d.getMonth() + 1).padStart(2, '0'); const year = d.getFullYear(); diff --git a/apps/web/src/app/(portal)/modules/tender-radar/components/ResultsList.tsx b/apps/web/src/app/(portal)/modules/tender-radar/components/ResultsList.tsx index 0bad2ea..550d1b0 100644 --- a/apps/web/src/app/(portal)/modules/tender-radar/components/ResultsList.tsx +++ b/apps/web/src/app/(portal)/modules/tender-radar/components/ResultsList.tsx @@ -48,7 +48,7 @@ interface TriageState { function formatDate(value: string | null): string { if (!value) return '–'; const d = new Date(value); - if (isNaN(d.getTime())) return '–'; + if (Number.isNaN(d.getTime())) return '–'; return d.toLocaleDateString('de-DE'); } diff --git a/apps/web/src/app/(portal)/modules/tender-radar/components/TenderDetail.tsx b/apps/web/src/app/(portal)/modules/tender-radar/components/TenderDetail.tsx index 7918587..f222a51 100644 --- a/apps/web/src/app/(portal)/modules/tender-radar/components/TenderDetail.tsx +++ b/apps/web/src/app/(portal)/modules/tender-radar/components/TenderDetail.tsx @@ -41,7 +41,7 @@ interface TenderDetailProps { function formatDeadline(value: string | null, noDeadlineLabel: string): string { if (!value) return noDeadlineLabel; const d = new Date(value); - if (isNaN(d.getTime())) return noDeadlineLabel; + if (Number.isNaN(d.getTime())) return noDeadlineLabel; return d.toLocaleDateString('de-DE'); } @@ -62,7 +62,7 @@ function formatValue(value: string | null, noValueLabel: string): string { function formatPublished(value: string): string { const d = new Date(value); - if (isNaN(d.getTime())) return '–'; + if (Number.isNaN(d.getTime())) return '–'; return d.toLocaleDateString('de-DE'); }