org-clock: Fix `org-clock-get-sum-start'

* lisp/org-clock.el (org-clock-get-sum-start): Return time as UTC.

Reported-by: Josh Moller-Mara <jmm@CNS.NYU.EDU>
<http://lists.gnu.org/archive/html/emacs-orgmode/2017-08/msg00128.html>
This commit is contained in:
Nicolas Goaziou 2017-08-07 13:25:20 +02:00
parent f6a28ba1c2
commit 43a1d5e920
1 changed files with 11 additions and 11 deletions

View File

@ -1418,11 +1418,13 @@ for a todo state to switch to, overriding the existing value
(defun org-clock-get-sum-start ()
"Return the time from which clock times should be counted.
This is for the currently running clock as it is displayed
in the mode line. This function looks at the properties
LAST_REPEAT and in particular CLOCK_MODELINE_TOTAL and the
corresponding variable `org-clock-mode-line-total' and then
decides which time to use."
This is for the currently running clock as it is displayed in the
mode line. This function looks at the properties LAST_REPEAT and
in particular CLOCK_MODELINE_TOTAL and the corresponding variable
`org-clock-mode-line-total' and then decides which time to use.
The time is always returned as UTC."
(let ((cmt (or (org-entry-get nil "CLOCK_MODELINE_TOTAL")
(symbol-name org-clock-mode-line-total)))
(lr (org-entry-get nil "LAST_REPEAT")))
@ -1432,13 +1434,13 @@ decides which time to use."
(current-time))
((equal cmt "today")
(setq org--msg-extra "showing today's task time.")
(let* ((dt (decode-time))
(let* ((dt (decode-time nil t))
(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)))
(setq dt (append (list 0 0) (nthcdr 2 dt) '(nil t)))
(apply #'encode-time dt)))
((or (equal cmt "all")
(and (or (not cmt) (equal cmt "auto"))
(not lr)))
@ -1448,9 +1450,7 @@ decides which time to use."
(and (or (not cmt) (equal cmt "auto"))
lr))
(setq org--msg-extra "showing task time since last repeat.")
(if (not lr)
nil
(org-time-string-to-time lr)))
(and lr (org-time-string-to-time lr t)))
(t nil))))
(defun org-clock-find-position (find-unclosed)