fix: avoid fabricated dates on tender cards

This commit is contained in:
2026-09-06 16:27:20 +03:00
parent f9bf95dbf9
commit d00177ccc8
2 changed files with 10 additions and 3 deletions
+4 -3
View File
@@ -8,8 +8,9 @@ export const TenderCard = ({ tender }) => {
const eslesenKalemler = (kalemEslesen && tender.ikn && kalemEslesen.get(tender.ikn)) || null;
const isFavKurum = favoriteKurumlar?.includes((tender.kurum || '').trim());
const [day, monthYear] = tender.tarih ? tender.tarih.split('.') : ['01', '01.2026'];
const monthYearFormatted = monthYear ? `${monthYear}` : '08.2026';
const dateMatch = /^(\d{2})\.(\d{2})\.(\d{4})(?:\s|$)/.exec(String(tender.tarih || '').trim());
const day = dateMatch?.[1] || '—';
const monthYearFormatted = dateMatch ? `${dateMatch[2]}.${dateMatch[3]}` : 'Tarih doğrulanmalı';
// İlan (yayım) tarihi kaynaklara göre farklı biçimde geliyor:
// canlı akış ISO (2026-08-30), DT/arşiv gg.aa.yyyy. İkisini de gösterebilelim.
@@ -35,7 +36,7 @@ export const TenderCard = ({ tender }) => {
<span className="text-3xl font-black tracking-tight text-blue-700 leading-none">{day}</span>
<span className="text-xs font-bold text-blue-900/80 mt-0.5">{monthYearFormatted}</span>
<span className="text-[11px] font-semibold bg-white/80 px-2 py-0.5 rounded-full text-blue-800 mt-2 border border-blue-200">
{tender.saat}
{tender.saat || 'Saat doğrulanmalı'}
</span>
</div>