]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix up iso8601 time match regexp
authorLars Ingebrigtsen <larsi@gnus.org>
Sun, 29 Sep 2019 11:03:08 +0000 (13:03 +0200)
committerLars Ingebrigtsen <larsi@gnus.org>
Sun, 29 Sep 2019 11:03:08 +0000 (13:03 +0200)
* lisp/calendar/iso8601.el (iso8601--time-match): The fraction
mark can be either . or , and there can be arbitrarily many digits
in the fraction.

lisp/calendar/iso8601.el

index 0f42c824e327f6d15a1344544deda6defc7d6c20..f8949914f78c433c2c0aec3b11ffc933eb440525 100644 (file)
@@ -83,7 +83,7 @@
          iso8601--ordinal-date-match)))
 
 (defconst iso8601--time-match
-  "\\([0-9][0-9]\\):?\\([0-9][0-9]\\)?:?\\([0-9][0-9]\\)?\\.?\\([0-9][0-9][0-9]\\)?")
+  "\\([0-9][0-9]\\):?\\([0-9][0-9]\\)?:?\\([0-9][0-9]\\)?[.,]?\\([0-9]+\\)?")
 
 (defconst iso8601--zone-match
   "\\(Z\\|\\([-+]\\)\\([0-9][0-9]\\):?\\([0-9][0-9]\\)?\\)")
@@ -232,7 +232,7 @@ well as variants like \"2008W32\" (week number) and
                            (string-to-number (match-string 3 time))))
               ;; Hm...
               (_millisecond (and (match-string 4 time)
-                                 (string-to-number (match-string 4 time)))))
+                             (string-to-number (match-string 4 time)))))
           (iso8601--decoded-time :hour hour
                                  :minute (or minute 0)
                                  :second (or second 0)