fix: align list expiry and date ordering with tender deadlines

This commit is contained in:
2026-09-06 09:18:41 +03:00
parent a87ee758bc
commit 9c7055a543
6 changed files with 64 additions and 28 deletions
+4 -2
View File
@@ -1,9 +1,11 @@
import { useDeadlineClock } from '../hooks/useDeadlineClock';
import React, { useEffect, useState } from 'react';
import { useApp } from '../context/AppContext';
import { Database, PlusCircle, Eye, Layers, Trophy, TrendingDown } from 'lucide-react';
import { bugunEklendi, acikIhale } from '../services/ihaleTarih';
export const LiveStatsBar = () => {
const now = useDeadlineClock();
const { liveStats, tenders } = useApp();
const yukluIhale = tenders.length;
@@ -11,9 +13,9 @@ export const LiveStatsBar = () => {
const kalemSayisi = tenders.reduce((s, t) => s + (t.items?.length || 0), 0);
// Üst kartla (BUGÜN EKLENENLER) AYNI ölçüt: bugün yayımlanan ve süresi
// geçmemiş ilanlar (ilan.gov.tr + DT). İki bant farklı sayı göstermesin.
const bugun = new Date(); bugun.setHours(0, 0, 0, 0);
const bugunEklenen = tenders.length
? tenders.filter((t) => acikIhale(t, bugun) && bugunEklendi(t)).length
? tenders.filter((t) => acikIhale(t, now) && bugunEklendi(t)).length
: liveStats.bugunEklenen;
// Havuz sağlığı: kaynak (ilan.gov.tr) sayısı 7 GÜNLÜK ORTALAMANIN çok altındaysa