Show absolute date in Budget Reset column
Relative labels ("today", "in 2 days", "on May 12, 2026") mixed three
shapes in one column, breaking scannability. Always render MMM D, YYYY
for consistency and easier at-a-glance comparison across members.
This commit is contained in:
parent
6be8313147
commit
1f6e01802d
@ -4,10 +4,5 @@ export function formatBudgetReset(iso: string | null | undefined): string | null
|
||||
if (!iso) return null;
|
||||
const resetDate = dayjs(iso);
|
||||
if (!resetDate.isValid()) return null;
|
||||
|
||||
const days = resetDate.diff(dayjs(), "day");
|
||||
if (days < 0) return `on ${resetDate.format("MMM D, YYYY")}`;
|
||||
if (days === 0) return "today";
|
||||
if (days < 7) return `in ${days} day${days === 1 ? "" : "s"}`;
|
||||
return `on ${resetDate.format("MMM D, YYYY")}`;
|
||||
return resetDate.format("MMM D, YYYY");
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user