emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals-release/org bc857bf: agenda: Fix "org-duration-to-minut


From: ELPA Syncer
Subject: [elpa] externals-release/org bc857bf: agenda: Fix "org-duration-to-minutes: Invalid duration format" error
Date: Sun, 9 May 2021 15:57:10 -0400 (EDT)

branch: externals-release/org
commit bc857bfc62ba94e04fb338bfb35f4b612c114d0c
Author: Nicolas Goaziou <mail@nicolasgoaziou.fr>
Commit: Nicolas Goaziou <mail@nicolasgoaziou.fr>

    agenda: Fix "org-duration-to-minutes: Invalid duration format" error
    
    * lisp/org-agenda.el (org-agenda-format-item): Compute duration with
    `org-duration-to-minutes' before normalizing input.
    
    Reported-by: Stephen Eglen <sje30@cam.ac.uk>
    <http://lists.gnu.org/r/emacs-orgmode/2021-05/msg00584.html>
---
 lisp/org-agenda.el | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el
index b91bf3a..f215b55 100644
--- a/lisp/org-agenda.el
+++ b/lisp/org-agenda.el
@@ -6656,9 +6656,6 @@ Any match of REMOVE-RE will be removed from TXT."
                           (= (match-beginning 0) 0)
                         t))
              (setq txt (replace-match "" nil nil txt))))
-         ;; Normalize the time(s) to 24 hour
-         (when s1 (setq s1 (org-get-time-of-day s1 'string t)))
-         (when s2 (setq s2 (org-get-time-of-day s2 'string t)))
 
          ;; Try to set s2 if s1 and
          ;; `org-agenda-default-appointment-duration' are set
@@ -6672,7 +6669,11 @@ Any match of REMOVE-RE will be removed from TXT."
          ;; Compute the duration
          (when s2
            (setq duration (- (org-duration-to-minutes s2)
-                             (org-duration-to-minutes s1)))))
+                             (org-duration-to-minutes s1))))
+
+          ;; Normalize the time(s) to 24 hour
+         (when s1 (setq s1 (org-get-time-of-day s1 'string t)))
+         (when s2 (setq s2 (org-get-time-of-day s2 'string t))))
 
        (when (string-match org-tag-group-re txt)
          ;; Tags are in the string



reply via email to

[Prev in Thread] Current Thread [Next in Thread]