fix: align list expiry and date ordering with tender deadlines
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user