mirror of
https://git.savannah.gnu.org/git/emacs.git
synced 2024-11-24 07:20:37 +00:00
Fix Icalendar export with ISO dates
* 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.
This commit is contained in:
parent
4fc3771078
commit
71f8b2c324
@ -895,8 +895,8 @@ it uses the current calendar date style."
|
||||
(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)
|
||||
|
@ -368,6 +368,9 @@ END:VTIMEZONE
|
||||
(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)
|
||||
|
Loading…
Reference in New Issue
Block a user