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.
This commit is contained in:
Ihor Radchenko 2024-01-10 16:05:48 +01:00
parent d0a917ab23
commit f22be2878f
No known key found for this signature in database
GPG Key ID: 6470762A7DA11D8B
1 changed files with 8 additions and 12 deletions

View File

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