Browse Source

Fix bug with "yesterday" in clocktables.

Carsten Dominik 17 years ago
parent
commit
e6b8a60432
2 changed files with 12 additions and 1 deletions
  1. 6 0
      lisp/ChangeLog
  2. 6 1
      lisp/org-clock.el

+ 6 - 0
lisp/ChangeLog

@@ -1,3 +1,9 @@
+2008-06-23  Carsten Dominik  <dominik@science.uva.nl>
+
+	* org-clock.el (org-clocktable-shift): Also undertand yesterday,
+	lastweek etc.
+	(org-clock-special-range): Also undertand yesterday, lastweek etc.
+
 2008-06-18  Glenn Morris  <rgm@gnu.org>
         * org.el (org-map-entries): Let-bind `file'.
 

+ 6 - 1
lisp/org-clock.el

@@ -638,7 +638,7 @@ the returned times will be formatted strings."
      ((string-match "\\([-+][0-9]+\\)$" skey)
       (setq shift (string-to-number (match-string 1 skey))
 	    key (intern (substring skey 0 (match-beginning 1))))))
-    (unless shift
+    (when (= shift 0)
       (cond ((eq key 'yesterday) (setq key 'today shift -1))
 	    ((eq key 'lastweek)  (setq key 'week  shift -1))
 	    ((eq key 'lastmonth) (setq key 'month shift -1))
@@ -689,6 +689,11 @@ the currently selected interval size."
       (let* ((b (match-beginning 1)) (e (match-end 1))
 	     (s (match-string 1))
 	     block shift ins y mw d date wp m)
+	(cond
+	 ((equal s "yesterday") (setq s "today-1"))
+	 ((equal s "lastweek") (setq s "thisweek-1"))
+	 ((equal s "lastmonth") (setq s "thismonth-1"))
+	 ((equal s "lastyear") (setq s "thisyear-1")))
 	(cond
 	 ((string-match "^\\(today\\|thisweek\\|thismonth\\|thisyear\\)\\([-+][0-9]+\\)?$" s)
 	  (setq block (match-string 1 s)