diff --git a/src/components/insights/trends-row.tsx b/src/components/insights/trends-row.tsx index 558ce2cc9..4ef8ec119 100644 --- a/src/components/insights/trends-row.tsx +++ b/src/components/insights/trends-row.tsx @@ -152,7 +152,11 @@ export function TrendsRow({ annotations, confidence }: TrendsRowProps) { data-metric="mood" className="flex h-full min-h-[300px] flex-col gap-2" > - + r.measuredAt < recentCutoff); const olderDia = diaRows.filter((r) => r.measuredAt < recentCutoff); snapshot.bloodPressure = { diff --git a/src/lib/mood/__tests__/date-key.test.ts b/src/lib/mood/__tests__/date-key.test.ts index 7b23db63d..f815e54f4 100644 --- a/src/lib/mood/__tests__/date-key.test.ts +++ b/src/lib/mood/__tests__/date-key.test.ts @@ -47,7 +47,10 @@ describe("moodDateKey", () => { "2026-05-15", ); expect( - moodDateKey(new Date("2026-05-14T22:00:00Z"), undefined as unknown as string), + moodDateKey( + new Date("2026-05-14T22:00:00Z"), + undefined as unknown as string, + ), ).toBe("2026-05-15"); }); }); @@ -73,10 +76,7 @@ describe("effectiveMoodTz", () => { describe("read-path interpretation of legacy vs new rows", () => { // Build a row's day-key the way the route writes it: write the // instant `moodLoggedAt`, anchored to the row's resolved tz. - function bucketFor(row: { - moodLoggedAt: Date; - tz: string | null; - }): string { + function bucketFor(row: { moodLoggedAt: Date; tz: string | null }): string { return moodDateKey(row.moodLoggedAt, effectiveMoodTz(row)); } diff --git a/src/lib/mood/date-key.ts b/src/lib/mood/date-key.ts index ad2ae64dc..eb7801697 100644 --- a/src/lib/mood/date-key.ts +++ b/src/lib/mood/date-key.ts @@ -52,6 +52,8 @@ export function moodDateKey(date: Date, tz: string): string { * non-null `tz` column takes precedence; legacy rows fall back to * Europe/Berlin. */ -export function effectiveMoodTz(row: { tz: string | null | undefined }): string { +export function effectiveMoodTz(row: { + tz: string | null | undefined; +}): string { return row.tz && row.tz.length > 0 ? row.tz : DEFAULT_TIMEZONE; }