summaryrefslogtreecommitdiff
path: root/lisp/calendar/iso8601.el
diff options
context:
space:
mode:
authorLars Ingebrigtsen <larsi@gnus.org>2020-01-30 02:11:09 +0100
committerLars Ingebrigtsen <larsi@gnus.org>2020-01-30 02:11:15 +0100
commit7c7b91b9fe156b6af4643ca4aa8f4a5c4aeb915f (patch)
tree5b939400040405df08d6946620793b1a3a2237e9 /lisp/calendar/iso8601.el
parent5db3324a7e11280437e69e27fe364dfd80b66ca2 (diff)
downloademacs-7c7b91b9fe156b6af4643ca4aa8f4a5c4aeb915f.tar.gz
Make iso8601.el understand two obsolete forms
* lisp/calendar/iso8601.el (iso8601-parse-date): Understand some obsolete formats to provide compatibility with the vCard RFC (bug#39347).
Diffstat (limited to 'lisp/calendar/iso8601.el')
-rw-r--r--lisp/calendar/iso8601.el6
1 files changed, 6 insertions, 0 deletions
diff --git a/lisp/calendar/iso8601.el b/lisp/calendar/iso8601.el
index e42fe0fa21f..858d561f188 100644
--- a/lisp/calendar/iso8601.el
+++ b/lisp/calendar/iso8601.el
@@ -202,6 +202,12 @@ See `decode-time' for the meaning of FORM."
(iso8601--decoded-time :year year
:month (decoded-time-month month-day)
:day (decoded-time-day month-day))))
+ ;; Obsolete format with implied year: --MM
+ ((iso8601--match "--\\([0-9][0-9]\\)" string)
+ (iso8601--decoded-time :month (string-to-number (match-string 1 string))))
+ ;; Obsolete format with implied year and month: ---DD
+ ((iso8601--match "---\\([0-9][0-9]\\)" string)
+ (iso8601--decoded-time :day (string-to-number (match-string 1 string))))
(t
(signal 'wrong-type-argument string))))