diff options
author | Leon Rische <leon.rische@me.com> | 2020-02-08 15:21:20 +0100 |
---|---|---|
committer | Leon Rische <leon.rische@me.com> | 2020-02-08 15:21:20 +0100 |
commit | d2b2a4fb9489e55013c0af2782fb32f13bd4e6fd (patch) | |
tree | 318918b2f10c175710c24c8570ef336a079b42c6 /org-fc-dashboard.el | |
parent | fcc36370abdebbf9aba84d3373f4811e8dd8406f (diff) |
Add estimates of future reviews
Diffstat (limited to 'org-fc-dashboard.el')
-rw-r--r-- | org-fc-dashboard.el | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/org-fc-dashboard.el b/org-fc-dashboard.el index 97dab2e..e92dfa2 100644 --- a/org-fc-dashboard.el +++ b/org-fc-dashboard.el @@ -38,6 +38,16 @@ :type 'string :group 'org-fc) +;;; Statistics + +(defun org-fc-review-estimate (paths n) + "Positions due in the next N days" + (let ((now (+ (time-to-seconds (current-time)) + (* 60 60 24 n)))) + (count-if + (lambda (pos) (< (time-to-seconds (plist-get pos :due)) now)) + (org-fc-awk-positions-for-paths paths)))) + ;;; Bar-Chart Generation (defun org-fc-dashboard-bar-chart (stat) @@ -53,8 +63,8 @@ (svg (svg-create width height))) (do ((values values (cdr values)) (pos 0 (+ pos (* width (caar values))))) - ((null values) '()) - (svg-rectangle svg pos 0 (* width (caar values)) height :fill (cdar values))) + ((null values) '()) + (svg-rectangle svg pos 0 (* width (caar values)) height :fill (cdar values))) (svg-image svg))) (defun org-fc-dashboard-percent-right (stats) |