Surface total number of entries per month in heatmap

This commit is contained in:
Aaron Lichtman 2023-06-21 07:49:21 -07:00
parent bd921f2e05
commit babc6f2517
No known key found for this signature in database
GPG key ID: D046D019DC745EDA

View file

@ -45,9 +45,17 @@ class CalendarHeatmapExporter(TextExporter):
for month in range(1, 13): for month in range(1, 13):
if month > curr_month and year == curr_year: if month > curr_month and year == curr_year:
break break
entries_this_month = sum(month_journaling_freq[month].values())
if entries_this_month == 0:
entry_msg = "No entries"
elif entries_this_month == 1:
entry_msg = "1 entry"
else:
entry_msg = f"{entries_this_month} entries"
table = Table( table = Table(
title=f"{calendar.month_name[month]} {year}", title=f"{calendar.month_name[month]} {year} ({entry_msg})",
style="white", title_style="bold green",
box=box.SIMPLE_HEAVY, box=box.SIMPLE_HEAVY,
padding=0, padding=0,
) )