mirror of
https://github.com/christianvidalwolf-prog/Craze-Data-check.git
synced 2026-08-03 14:05:25 +02:00
Filter out old launch dates before Dec 2025 in Missing Data tabs
This commit is contained in:
@@ -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'));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user