summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThanos Apollo <[email protected]>2024-07-26 18:03:19 +0300
committerThanos Apollo <[email protected]>2024-07-26 18:04:05 +0300
commit889a1aa87a5ed46639aa9f1fdb513821c8f68c8f (patch)
treed96a23e9bd9966f52a901f1856785e0dc724b922
parent3f2771eed6528a2a431ce995e40f57599041629f (diff)
dashboard-output-average-rev: Don't include days with 0 reviews.
* Output includes only days with >0 reviews.
-rw-r--r--gnosis-dashboard.el3
1 files changed, 2 insertions, 1 deletions
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)