From 889a1aa87a5ed46639aa9f1fdb513821c8f68c8f Mon Sep 17 00:00:00 2001 From: Thanos Apollo Date: Fri, 26 Jul 2024 18:03:19 +0300 Subject: dashboard-output-average-rev: Don't include days with 0 reviews. * Output includes only days with >0 reviews. --- gnosis-dashboard.el | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'gnosis-dashboard.el') diff --git a/gnosis-dashboard.el b/gnosis-dashboard.el index 26550bf..7b17239 100644 --- a/gnosis-dashboard.el +++ b/gnosis-dashboard.el @@ -101,8 +101,9 @@ Skips days where no note was reviewed." (let ((total 0) (entries (gnosis-dashboard-year-stats))) (cl-loop for entry in entries + when (not (= entry 0)) do (setq total (+ total entry))) - (/ total (length (remove 0 entries))))) + (/ total (max (length (remove 0 entries)) 1)))) ;; TODO: Add more conds & faces (defun gnosis-dashboard--graph-propertize (string num) -- cgit v1.2.3