From 369e37c8f5b9a20bd20579c8a4146ad37ca3131b Mon Sep 17 00:00:00 2001 From: Christian Vidal Wolf Date: Mon, 20 Apr 2026 20:24:39 +0200 Subject: [PATCH] Filter out old launch dates before Dec 2025 in Missing Data tabs --- src/components/MissingDataView.tsx | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/components/MissingDataView.tsx b/src/components/MissingDataView.tsx index 7b9595e..391cf04 100644 --- a/src/components/MissingDataView.tsx +++ b/src/components/MissingDataView.tsx @@ -138,6 +138,8 @@ export function MissingDataView({ data, headers, onSaveRow, onCaptureState }: Mi } if (activeTab === 'launchInconsistent' || activeTab === 'upcomingLaunch') { + const minDate = new Date('2025-12-01'); + result = result.map(r => { const launchVal = launchDateCol >= 0 ? r.row[launchDateCol] : undefined; const readyVal = readyToOrderCol >= 0 ? r.row[readyToOrderCol] : undefined; @@ -151,6 +153,10 @@ export function MissingDataView({ data, headers, onSaveRow, onCaptureState }: Mi const diffTime = launchD.getTime() - today.getTime(); daysUntil = Math.ceil(diffTime / (1000 * 60 * 60 * 24)); + if (launchD < minDate) { + return null; + } + if (activeTab === 'launchInconsistent') { if (readyDate && /^\d{4}-\d{2}-\d{2}$/.test(readyDate)) { const readyD = new Date(readyDate); @@ -180,14 +186,16 @@ export function MissingDataView({ data, headers, onSaveRow, onCaptureState }: Mi return { ...r, status, daysUntil }; }); + result = result.filter(r => r !== null); + if (activeTab === 'launchInconsistent') { result = result.filter(r => - r.status === 'error_ready_after_launch' || (r.status === 'ok' && r.daysUntil > 0 && isEmptyOrEpoch(launchDateCol >= 0 ? r.row[readyToOrderCol] : undefined)) + r && (r.status === 'error_ready_after_launch' || (r.status === 'ok' && r.daysUntil > 0 && isEmptyOrEpoch(r.row[readyToOrderCol]))) ); } if (activeTab === 'upcomingLaunch') { - result = result.filter(r => r.status === 'warning' || r.status === 'critical' || r.status === 'past'); + result = result.filter(r => r && (r.status === 'warning' || r.status === 'critical' || r.status === 'past')); } }