From 5639c172509cbdc9a55db6fbdad952ac1b880f70 Mon Sep 17 00:00:00 2001 From: Aki Date: Thu, 29 Aug 2024 18:55:47 +0200 Subject: Added last 365 stat summary --- main.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/main.go b/main.go index e139fe3..53fc5c1 100644 --- a/main.go +++ b/main.go @@ -101,6 +101,10 @@ func handleHome(pathname string) func(http.ResponseWriter, *http.Request) { if err == nil { home.Stats = append(home.Stats, count("Last 30 days", len(last_month))) } + last_year, err := EntriesSince(now.AddDate(0, 0, -365)) + if err == nil { + home.Stats = append(home.Stats, count("Last 365 days", len(last_year))) + } total, err := CountEntries() if err == nil { home.Stats = append(home.Stats, count("All time", int(total))) -- cgit v1.1