import { getAuditDayKey } from '@admin/utils/audit/get-audit-day-key' export function getAuditDayLabel(dayKey: string, now = new Date()): string { const todayKey = getAuditDayKey(now.toISOString()) if (dayKey === todayKey) return 'Today' const yesterdayKey = getAuditDayKey(new Date(now.getTime() - 24 * 60 * 60 * 1000).toISOString()) if (dayKey === yesterdayKey) return 'Yesterday' const [year, month, day] = dayKey.split('-').map(Number) if (!year || !month || !day) return dayKey return new Intl.DateTimeFormat('en-US', { month: 'short', day: 'numeric', year: year === now.getFullYear() ? undefined : 'numeric' }).format(new Date(year, month - 1, day)) }