org-clock: Fix special strings in :tstart and :tend

* lisp/org-clock.el (org-clocktable-steps): Handle relative time
  strings like "<-1w>".
This commit is contained in:
Nicolas Goaziou 2018-11-17 21:45:16 +01:00
parent 7bf3c10819
commit fc9cf62bf3
1 changed files with 2 additions and 4 deletions

View File

@ -2710,15 +2710,13 @@ The TS argument has the same type as the return values of
;; org-agenda. ;; org-agenda.
(pcase-let ((`(,month ,day ,year) (calendar-gregorian-from-absolute ts))) (pcase-let ((`(,month ,day ,year) (calendar-gregorian-from-absolute ts)))
(setq ts (float-time (encode-time 0 0 0 day month year))))) (setq ts (float-time (encode-time 0 0 0 day month year)))))
(ts (ts (setq ts (org-matcher-time ts))))
(setq ts (float-time (apply #'encode-time (org-parse-time-string ts))))))
(cond (cond
((numberp te) ((numberp te)
;; Likewise for te. ;; Likewise for te.
(pcase-let ((`(,month ,day ,year) (calendar-gregorian-from-absolute te))) (pcase-let ((`(,month ,day ,year) (calendar-gregorian-from-absolute te)))
(setq te (float-time (encode-time 0 0 0 day month year))))) (setq te (float-time (encode-time 0 0 0 day month year)))))
(te (te (setq te (org-matcher-time te))))
(setq te (float-time (apply #'encode-time (org-parse-time-string te))))))
(setq tsb (setq tsb
(if (eq step0 'week) (if (eq step0 'week)
(let ((dow (nth 6 (decode-time (seconds-to-time ts))))) (let ((dow (nth 6 (decode-time (seconds-to-time ts)))))