From 95e09c6d21a64246b12edc86890eac31a407915f Mon Sep 17 00:00:00 2001 From: Robin Schanbacher Date: Mon, 3 Aug 2026 18:06:01 +0200 Subject: [PATCH] feat: add total to timeMap --- app/evaluation/[days]/[...ical-link]/page.tsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/evaluation/[days]/[...ical-link]/page.tsx b/app/evaluation/[days]/[...ical-link]/page.tsx index cea05d0..e1819f5 100644 --- a/app/evaluation/[days]/[...ical-link]/page.tsx +++ b/app/evaluation/[days]/[...ical-link]/page.tsx @@ -31,7 +31,9 @@ function getCategories(categoriesField: any): string[] { type TimeMap = Record export default async function EvaluationPage({ params }: PageProps) { - let times: TimeMap = {}; + let times: TimeMap = { + total: 0 + }; // get all params const resolvedParams = await params; @@ -77,6 +79,7 @@ export default async function EvaluationPage({ params }: PageProps) { const categories = getCategories(event.categories); categories.forEach((cat) => { + times["total"] = (times["total"] || 0) + durationInMinutes times[cat] = (times[cat] || 0) + durationInMinutes }) })