diff options
author | Carsten Dominik <carsten.dominik@gmail.com> | 2013-10-17 07:41:49 +0200 |
---|---|---|
committer | Carsten Dominik <carsten.dominik@gmail.com> | 2013-10-17 07:41:49 +0200 |
commit | d73bde62fef296fcaa9beb29b5000c2f648c73f5 (patch) | |
tree | a641cc2cf41b8f3a7f894b2167c5b1039d660c77 | |
parent | e04a22ed2d66726dae5c26f89268eedc3082c894 (diff) | |
download | org-mode-d73bde62fef296fcaa9beb29b5000c2f648c73f5.tar.gz |
Fix incorrect time calculation for `org-extend-today-until'
* lisp/org-clock.el (org-clock-get-sum-start): Fix bad date
math, affecting mode line and clock tables.
Patch by Ian Kelling
-rw-r--r-- | lisp/org-clock.el | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/lisp/org-clock.el b/lisp/org-clock.el index 9f22562..3195dc1 100644 --- a/lisp/org-clock.el +++ b/lisp/org-clock.el @@ -1368,10 +1368,12 @@ decides which time to use." (current-time)) ((equal cmt "today") (setq msg-extra "showing today's task time.") - (let* ((dt (decode-time (current-time)))) - (setq dt (append (list 0 0 0) (nthcdr 3 dt))) - (if org-extend-today-until - (setf (nth 2 dt) org-extend-today-until)) + (let* ((dt (decode-time (current-time))) + (hour (nth 2 dt)) + (day (nth 3 dt))) + (if (< hour org-extend-today-until) (setf (nth 3 dt) (1- day))) + (setf (nth 2 dt) org-extend-today-until) + (setq dt (append (list 0 0) (nthcdr 2 dt))) (apply 'encode-time dt))) ((or (equal cmt "all") (and (or (not cmt) (equal cmt "auto")) |