* lisp/calendar/icalendar.el (icalendar--datestring-to-isodate):
Accept dashes in ISO-style numeric dates. Patch by Erwan Hingant
<erwan.hingant@mailo.com>. (Bug#69894)
* test/lisp/calendar/icalendar-tests.el
(icalendar--datestring-to-isodate): Add a test for dashes in
ISO-style numeric dates.
(cherry picked from commit
71f8b2c3242b9b9455e9c6f25ad99ea900a1422f)
(save-match-data
(cond ( ;; iso-style numeric date
(string-match (concat "\\s-*"
- "\\([0-9]\\{4\\}\\)[ \t/]\\s-*"
- "0?\\([1-9][0-9]?\\)[ \t/]\\s-*"
+ "\\([0-9]\\{4\\}\\)[ \t/-]\\s-*"
+ "0?\\([1-9][0-9]?\\)[ \t/-]\\s-*"
"0?\\([1-9][0-9]?\\)")
datestring)
(setq year (read (substring datestring (match-beginning 1)
(icalendar--datestring-to-isodate "2008 05 31")))
(should (string= "20080602"
(icalendar--datestring-to-isodate "2008 05 31" 2)))
+ ;; Bug#69894
+ (should (string= "20240319"
+ (icalendar--datestring-to-isodate "2024-03-19")))
;; numeric european
(setq calendar-date-style 'european)