From babc6f251770f408234b79cfe6cf9249ff81a57f Mon Sep 17 00:00:00 2001 From: Aaron Lichtman Date: Wed, 21 Jun 2023 07:49:21 -0700 Subject: [PATCH] Surface total number of entries per month in heatmap --- jrnl/plugins/calendar_heatmap_exporter.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/jrnl/plugins/calendar_heatmap_exporter.py b/jrnl/plugins/calendar_heatmap_exporter.py index 010ab401..8476e662 100644 --- a/jrnl/plugins/calendar_heatmap_exporter.py +++ b/jrnl/plugins/calendar_heatmap_exporter.py @@ -45,9 +45,17 @@ class CalendarHeatmapExporter(TextExporter): for month in range(1, 13): if month > curr_month and year == curr_year: 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( - title=f"{calendar.month_name[month]} {year}", - style="white", + title=f"{calendar.month_name[month]} {year} ({entry_msg})", + title_style="bold green", box=box.SIMPLE_HEAVY, padding=0, )