fix(scheduling): 近7天 filter should be time-only, not exclude cancelled
Previously the toggle hid cancelled records, so users who clicked a record timestamped within 7 days but later cancelled would see nothing. Now 近7天 filters purely by createdAt; combine with status tabs to narrow further. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -67,7 +67,7 @@ export default function NotificationHistory({ onClose, onChange, recentOnly = fa
|
||||
const visibleRecords = recent7d
|
||||
? records.filter(r => {
|
||||
const t = Date.parse(r.createdAt);
|
||||
return Number.isFinite(t) && Date.now() - t <= SEVEN_DAYS_MS && r.status !== 'cancelled';
|
||||
return Number.isFinite(t) && Date.now() - t <= SEVEN_DAYS_MS;
|
||||
})
|
||||
: records;
|
||||
|
||||
@@ -161,7 +161,7 @@ export default function NotificationHistory({ onClose, onChange, recentOnly = fa
|
||||
className={`text-[11px] px-3 py-1 rounded-full font-medium cursor-pointer transition-colors ${
|
||||
recent7d ? 'bg-emerald-600 text-white' : 'bg-slate-100 text-slate-500 hover:bg-slate-200'
|
||||
}`}
|
||||
title="仅看最近 7 天(不含已取消)"
|
||||
title="仅看最近 7 天"
|
||||
>
|
||||
近 7 天
|
||||
</button>
|
||||
|
||||
Reference in New Issue
Block a user