0
0
Fork 1
mirror of https://git.savannah.gnu.org/git/emacs/org-mode.git synced 2024-09-29 19:37:52 +00:00

org.el: (org-get-cursor-date): Fix regular expression

* lisp/org.el (org-get-cursor-date): Fix regular expression.

Previous regular expression assumed the time grid string will have two
digits in the hour portion of the time string.  However, the time grid
string does not always have two digits.  For example:

" 8:00......"
This commit is contained in:
Nicholas Vollmer 2020-08-02 14:42:34 -04:00 committed by Kyle Meyer
parent 81e2948472
commit ab9b14a80f

View file

@ -19064,7 +19064,7 @@ earliest time on the cursor date that Org treats as that date
(let (date day defd tp hod mod)
(when with-time
(setq tp (get-text-property (point) 'time))
(when (and tp (string-match "\\([0-9][0-9]\\):\\([0-9][0-9]\\)" tp))
(when (and tp (string-match "\\([0-2]?[0-9]\\):\\([0-5][0-9]\\)" tp))
(setq hod (string-to-number (match-string 1 tp))
mod (string-to-number (match-string 2 tp))))
(or tp (let ((now (decode-time)))