Enhance year handling

* lisp/org.el (org-read-date-analyze): Handle two-digit years with
`org-small-year-to-year' instead of just adding 2000
This commit is contained in:
Marcin Borkowski 2016-03-17 12:50:12 +01:00 committed by Nicolas Goaziou
parent 0ccdceeb87
commit ebd68ae499
1 changed files with 2 additions and 2 deletions

View File

@ -17011,7 +17011,7 @@ user."
(string-to-number (format-time-string "%Y"))))
month (string-to-number (match-string 3 ans))
day (string-to-number (match-string 4 ans)))
(when (< year 100) (setq year (+ 2000 year)))
(setq year (org-small-year-to-year year))
(setq ans (replace-match (format "%04d-%02d-%02d\\5" year month day)
t nil ans)))
@ -17035,7 +17035,7 @@ user."
(string-to-number (format-time-string "%Y"))))
month (string-to-number (match-string 1 ans))
day (string-to-number (match-string 2 ans)))
(when (< year 100) (setq year (+ 2000 year)))
(setq year (org-small-year-to-year year))
(setq ans (replace-match (format "%04d-%02d-%02d\\5" year month day)
t nil ans)))
;; Help matching am/pm times, because `parse-time-string' does not do that.