From b77f273e4ecb25a0922c0b2f64a637bdac53a622 Mon Sep 17 00:00:00 2001 From: Ammerhai Date: Thu, 26 Mar 2026 21:06:49 +0100 Subject: [PATCH] add days per category #5 --- src/work-calendar.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/work-calendar.cpp b/src/work-calendar.cpp index 9b2c8c7..912b96a 100644 --- a/src/work-calendar.cpp +++ b/src/work-calendar.cpp @@ -3,6 +3,7 @@ #include #include #include +#include #include "inter.h" #include "inter-bold.h" @@ -510,7 +511,13 @@ void per_frame(){ category.editing = false; } } else { - ImGui::Text("%s", category.name); + uint64_t num_days_this_year = 0; + for (size_t j = 0; j < num_categorized_days; j++) { + if (categorized_days[j].category == i && categorized_days[j].year == year) { + num_days_this_year++; + } + } + ImGui::Text("%s (%" PRIu64 ")", category.name, num_days_this_year); } ImGui::TableSetColumnIndex(2);