diff options
author | David Arroyo Menendez <davidam9@riseup.net> | 2014-03-15 10:15:34 +0100 |
---|---|---|
committer | David Arroyo Menendez <davidam9@riseup.net> | 2014-03-15 10:15:34 +0100 |
commit | 48dd94cc39a41c789bf23892dab27d38287d5d7e (patch) | |
tree | 2cfdaa8210e06306668544cd8f4c188fb6f95171 | |
parent | eb9c5ae49ad084b1a747aaa41f12457e06d771c9 (diff) | |
download | org-mode-48dd94cc39a41c789bf23892dab27d38287d5d7e.tar.gz |
org-effectiveness.el (org-effectiveness-plot-ascii): fixed the problem changing the year in org-effectivenss-plot-ascii
* org-effectiveness.el (org-effectiveness-plot-ascii): fixed the problem changing the year in org-effectivenss-plot-ascii
TINYCHANGE
-rw-r--r-- | contrib/lisp/org-effectiveness.el | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/contrib/lisp/org-effectiveness.el b/contrib/lisp/org-effectiveness.el index 4206a27..7cd0d1e 100644 --- a/contrib/lisp/org-effectiveness.el +++ b/contrib/lisp/org-effectiveness.el @@ -224,21 +224,22 @@ many TODO pending" (defun org-effectiveness-plot-ascii (startdate enddate) (interactive "sGive me the start date: \nsGive me the end date: " startdate enddate) (setq dates (org-effectiveness-check-dates startdate enddate)) - (setq syear (cadr (assoc 'startyear dates))) - (setq smonth (cadr (assoc 'startmonth dates))) - (setq eyear (cadr (assoc 'endyear dates))) - (setq emonth (cadr (assoc 'endmonth dates))) ;; (switch-to-buffer "*org-effectiveness*") - (let ((month smonth) - (year syear) + (let ((syear (cadr (assoc 'startyear dates))) + (smonth (cadr (assoc 'startmonth dates))) + (year (cadr (assoc 'startyear dates))) + (month (cadr (assoc 'startmonth dates))) + (emonth (cadr (assoc 'endmonth dates))) + (eyear (cadr (assoc 'endyear dates))) (str "")) - (while (and (>= eyear year) (>= emonth month)) + (while (or (>= eyear year) (and (= eyear year) (>= emonth month))) (org-effectiveness-ascii-bar (string-to-number (org-effectiveness-in-date (concat (number-to-string year) "-" (org-effectiveness-month-to-string month)) 1)) (format "%s-%s" year month)) - (if (= month 12) + (if (eq month 12) (progn (setq year (+ 1 year)) (setq month 1)) - (setq month (+ 1 month)))))) + (setq month (+ 1 month)))) +)) (provide 'org-effectiveness) |