fix(checkups): say "overdue since yesterday" instead of "overdue by 1 days"

The due phrase on the check-up card and the checkups page counted a
check-up one day past its date as "Overdue by 1 days", and the same
counted form read wrongly in German. One day over now has its own
phrase in all seven languages. Both overdue phrases keep the warning
colour through a shared `isOverdueDue` helper, so a surface no longer
compares against a single key.
This commit is contained in:
Marc-André Bombeck committed 2026-09-26 10:01:04 +02:00
1 parent 5fb5145d7a
commit f5bab3258a
12 files changed
+60 -9

No files matched your search

@@ -275,7 +275,9 @@ describe("<VorsorgeSection> loading + empty", () => {
} as MeasurementReminder;
remindersMock.mockReturnValue({ data: [reminder], isLoading: false });
const html = render(<VorsorgeSection />);
expect(html).toContain("Overdue by 1 days");
// One day over reads "since yesterday": the counted form printed
// "Overdue by 1 days", and the warning hue must follow both phrases.
expect(html).toContain("Overdue since yesterday");
expect(html).toContain("text-warning");
});
@@ -47,7 +47,10 @@ import {
useDisplayTimezone,
} from "@/lib/i18n/context";
import { relativeCalendarDate } from "@/lib/i18n/relative-time";
import { relativeDueKey } from "@/lib/measurement-reminders/due-day";
import {
isOverdueDue,
relativeDueKey,
} from "@/lib/measurement-reminders/due-day";
import { cn } from "@/lib/utils";
import { applyOrder, useModuleListPrefs } from "@/lib/module-list-prefs";
import { EncounterSheet } from "@/components/encounters/encounter-sheet";
@@ -899,8 +902,7 @@ function VorsorgeCard({
// routes to the check-in page), never the numeric value-entry wording.
const isScreening = isScreeningReminderType(reminder.measurementType);
const isDue =
due.key === "measurementReminders.nextDue.today" ||
due.key === "measurementReminders.overdueByDays";
due.key === "measurementReminders.nextDue.today" || isOverdueDue(due);
const progress = intervalProgress(reminder, now);
// Category-style header badge: the measurement label, or "self-planned"
@@ -1361,7 +1363,7 @@ function VorsorgeCard({
// normal muted-resolved date. The card surface stays neutral per the house
// rule; only this inline label carries the status hue.
const dueIsToday = due.key === "measurementReminders.nextDue.today";
const dueIsOverdue = due.key === "measurementReminders.overdueByDays";
const dueIsOverdue = isOverdueDue(due);
const nextLastSlot = (
<div className="min-h-[2.75rem] space-y-1.5 text-sm">
<div className="text-muted-foreground flex items-baseline justify-between gap-3">