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

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

[elpa] externals/org f22be2878f 2/2: org-agenda: Fix hard-coded day leng


From: ELPA Syncer
Subject: [elpa] externals/org f22be2878f 2/2: org-agenda: Fix hard-coded day lengths when calculating timestamp regexp
Date: Wed, 10 Jan 2024 10:48:19 -0500 (EST)

branch: externals/org
commit f22be2878fef0a00fed335e5aad9fe77eee62069
Author: Ihor Radchenko <yantar92@posteo.net>
Commit: Ihor Radchenko <yantar92@posteo.net>

    org-agenda: Fix hard-coded day lengths when calculating timestamp regexp
    
    * lisp/org-agenda.el (org-agenda-get-timestamps):
    (org-agenda-get-progress): Do not assume that all the timestamps have
    length of exactly 12 (English).  Use options argument for
    `org-time-stamp-format' instead to drop brackets from the timestamp.
---
 lisp/org-agenda.el | 20 ++++++++------------
 1 file changed, 8 insertions(+), 12 deletions(-)

diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el
index 13f450c523..073304b9ba 100644
--- a/lisp/org-agenda.el
+++ b/lisp/org-agenda.el
@@ -5816,12 +5816,10 @@ displayed in agenda view."
          (concat
           (if org-agenda-include-inactive-timestamps "[[<]" "<")
           (regexp-quote
-           (substring
-            (format-time-string
-             (org-time-stamp-format)
-             (org-encode-time  ; DATE bound by calendar
-              0 0 0 (nth 1 date) (car date) (nth 2 date)))
-            1 11))
+           (format-time-string
+            (org-time-stamp-format nil 'no-brackets)
+            (org-encode-time   ; DATE bound by calendar
+             0 0 0 (nth 1 date) (car date) (nth 2 date))))
           "\\|\\(<[0-9]+-[0-9]+-[0-9]+[^>\n]+?\\+[0-9]+[hdwmy]>\\)"
           "\\|\\(<%%\\(([^>\n]+)\\)>\\)"))
         timestamp-items)
@@ -6100,12 +6098,10 @@ then those holidays will be skipped."
                  "\\(" parts-re "\\)"
                  " *\\["
                  (regexp-quote
-                  (substring
-                   (format-time-string
-                    (org-time-stamp-format)
-                    (org-encode-time  ; DATE bound by calendar
-                     0 0 0 (nth 1 date) (car date) (nth 2 date)))
-                   1 11))))
+                  (format-time-string
+                   (org-time-stamp-format nil 'no-brackets)
+                   (org-encode-time  ; DATE bound by calendar
+                    0 0 0 (nth 1 date) (car date) (nth 2 date))))))
         (org-agenda-search-headline-for-time nil)
         marker hdmarker priority category level tags closedp type
         statep clockp state ee txt extra timestr rest clocked inherited-tags



reply via email to

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