Compare commits

...

2 Commits

Author SHA1 Message Date
45adcab93d add days per category
#5
2026-04-09 20:44:37 +02:00
b4e889cf33 fix to get the leap years correctly displayed 2026-04-09 20:44:27 +02:00

View File

@ -4,6 +4,7 @@
#include <stdio.h>
#include <stdint.h>
#include <hydrogen.h>
#include <inttypes.h>
#include "inter.h"
#include "inter-bold.h"
@ -494,7 +495,7 @@ void per_frame(){
if (ImGui::BeginTable("Weekdays", 7, ImGuiTableFlags_SizingFixedFit | ImGuiTableFlags_NoHostExtendX | ImGuiTableFlags_Borders)) {
int offset = weekday_from_day(year, month, 1);
for (int day = 1; day <= days_per_month(2025, month); day++) {
for (int day = 1; day <= days_per_month(year, month); day++) {
int weekday = weekday_from_day(year, month, day);
if (weekday == 0 || day == 1){
@ -635,7 +636,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);