summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarsten Dominik <carsten.dominik@gmail.com>2011-04-08 12:06:51 +0200
committerCarsten Dominik <carsten.dominik@gmail.com>2011-04-08 12:06:51 +0200
commitcd806a5d0d9d84706ead33ce8536960abb2cfe21 (patch)
treeb4a315a3d53ed105edde03edc51059e2976d72b4
parent4036da1986b689bc4fb4103055432ca6e21df0eb (diff)
downloadorg-mode-cd806a5d0d9d84706ead33ce8536960abb2cfe21.tar.gz
Help matching dotted European dates, like 31. 12. 2007
* lisp/org.el (org-read-date-analyze): Help matching dotted European dates, like 31. 12. 2007 Patch by Jan Seeger. TINYCHANGE
-rw-r--r--lisp/org.el13
1 files changed, 13 insertions, 0 deletions
diff --git a/lisp/org.el b/lisp/org.el
index 2c0a09b..0b55055 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -14636,6 +14636,19 @@ user."
(if (< year 100) (setq year (+ 2000 year)))
(setq ans (replace-match (format "%04d-%02d-%02d\\5" year month day)
t nil ans)))
+
+ ;; Help matching dottet european dates
+ (when (string-match
+ "^ *\\(3[01]\\|0?[1-9]\\|[12][0-9]\\)\\. ?\\(0?[1-9]\\|1[012]\\)\\. ?\\([1-9][0-9][0-9][0-9]\\)?" ans)
+ (setq year (if (match-end 3)
+ (string-to-number (match-string 3 ans))
+ (progn (setq kill-year t)
+ (string-to-number (format-time-string "%Y"))))
+ day (string-to-number (match-string 1 ans))
+ month (string-to-number (match-string 2 ans))
+ ans (replace-match (format "%04d-%02d-%02d\\5" year month day)
+ t nil ans)))
+
;; Help matching american dates, like 5/30 or 5/30/7
(when (string-match
"^ *\\(0?[1-9]\\|1[012]\\)/\\(0?[1-9]\\|[12][0-9]\\|3[01]\\)\\(/\\([0-9]+\\)\\)?\\([^/0-9]\\|$\\)" ans)