align daily bulletin with Istanbul date
This commit is contained in:
@@ -1,14 +1,15 @@
|
||||
import React from 'react';
|
||||
import { useApp } from '../../context/AppContext';
|
||||
import { Newspaper, Calendar, Building2, Package, ArrowRight } from 'lucide-react';
|
||||
import { istanbulDateKey } from '../../services/tenderCalendar';
|
||||
|
||||
export const DailyBulletin = () => {
|
||||
const { tenders, setActiveTenderDetail } = useApp();
|
||||
|
||||
// Bugün: yayımlanma (ilan) tarihi bugün olanlar; ilan tarihi yoksa havuza az önce eklenenler.
|
||||
const bugun = new Date();
|
||||
const todayStr = `${String(bugun.getDate()).padStart(2, '0')}.${String(bugun.getMonth() + 1).padStart(2, '0')}.${bugun.getFullYear()}`;
|
||||
const isoBugun = `${bugun.getFullYear()}-${String(bugun.getMonth() + 1).padStart(2, '0')}-${String(bugun.getDate()).padStart(2, '0')}`;
|
||||
const isoBugun = istanbulDateKey();
|
||||
const [bugunYil, bugunAy, bugunGun] = isoBugun.split('-');
|
||||
const todayStr = `${bugunGun}.${bugunAy}.${bugunYil}`;
|
||||
const bugunMu = (v) => !!v && (String(v).startsWith(isoBugun) || String(v).slice(0, 10) === todayStr);
|
||||
const todayTenders = tenders.filter(t =>
|
||||
bugunMu(t.ilanTarihi) || (!t.ilanTarihi && ((t.eklenmeZamani || '').includes('az') || (t.eklenmeZamani || '').includes('saat')))
|
||||
@@ -42,11 +43,11 @@ export const DailyBulletin = () => {
|
||||
<span className="text-[10px] font-extrabold bg-blue-100 text-blue-800 px-2 py-0.5 rounded">
|
||||
#{t.ikn}
|
||||
</span>
|
||||
<h3
|
||||
onClick={() => setActiveTenderDetail(t)}
|
||||
className="font-bold text-base text-slate-900 hover:text-blue-600 cursor-pointer mt-1"
|
||||
>
|
||||
{t.baslik}
|
||||
<h3>
|
||||
<button type="button" aria-haspopup="dialog" onClick={() => setActiveTenderDetail(t)}
|
||||
className="text-left font-bold text-base text-slate-900 hover:text-blue-600 cursor-pointer mt-1">
|
||||
{t.baslik}
|
||||
</button>
|
||||
</h3>
|
||||
</div>
|
||||
<span className="text-xs font-bold text-slate-500 bg-slate-100 px-2.5 py-1 rounded-md">
|
||||
@@ -72,6 +73,7 @@ export const DailyBulletin = () => {
|
||||
</div>
|
||||
|
||||
<button
|
||||
type="button"
|
||||
onClick={() => setActiveTenderDetail(t)}
|
||||
className="text-xs font-bold text-blue-600 hover:text-blue-800 flex items-center gap-1 hover:underline"
|
||||
>
|
||||
|
||||
Reference in New Issue
Block a user