From b5f1077b94960440b1064ca39c3c1e3ebabbb058 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Marc-Andr=C3=A9=20Bombeck?=
Date: Fri, 9 Oct 2026 13:53:33 +0200
Subject: [PATCH] fix(day): date the running list against the day on screen
DayRunning takes the viewed day, so a start in another year names its
year. The timeline's chronicle test reads the reworded gap line.
---
src/components/day/day-sections.tsx | 6 ++----
src/components/day/day-view.tsx | 2 +-
.../timeline/__tests__/timeline-components.test.tsx | 2 +-
3 files changed, 4 insertions(+), 6 deletions(-)
diff --git a/src/components/day/day-sections.tsx b/src/components/day/day-sections.tsx
index a4adfb11e..e2b627778 100644
--- a/src/components/day/day-sections.tsx
+++ b/src/components/day/day-sections.tsx
@@ -215,13 +215,11 @@ export function DayRunning({
}: {
items: readonly DayRunningItem[];
/** The viewed day; a start date in another year names its year. */
- date?: DateKey;
+ date: DateKey;
}) {
const { t, locale } = useTranslations();
if (items.length === 0) return null;
- const viewedYear = date
- ? date.slice(0, 4)
- : String(new Date().getUTCFullYear());
+ const viewedYear = date.slice(0, 4);
const intlLocale = resolveIntlLocale(locale);
const sinceText = (since: string): string =>
new Intl.DateTimeFormat(intlLocale, {
diff --git a/src/components/day/day-view.tsx b/src/components/day/day-view.tsx
index 1cfd7d6b1..e8d4b145c 100644
--- a/src/components/day/day-view.tsx
+++ b/src/components/day/day-view.tsx
@@ -332,7 +332,7 @@ export function DayView({
) : (
<>
-
+
{data.values.length > 0 ? (
diff --git a/src/components/timeline/__tests__/timeline-components.test.tsx b/src/components/timeline/__tests__/timeline-components.test.tsx
index 5a1ffdfb8..0a6613dd8 100644
--- a/src/components/timeline/__tests__/timeline-components.test.tsx
+++ b/src/components/timeline/__tests__/timeline-components.test.tsx
@@ -143,7 +143,7 @@ describe("chronicle", () => {
)}
/>,
);
- expect(html).toContain("April bis Oktober 2026 · keine Einträge");
+ expect(html).toContain("April bis Oktober 2026 ohne Einträge");
expect(html).toContain("Dauerhaft");
expect(html).toContain("2 Allergien");
expect(html).toContain("Erkältung vorbei");