]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix regression introduced by the previous date-to-time change
authorKatsumi Yamaoka <yamaoka@jpl.org>
Fri, 3 Dec 2021 16:28:48 +0000 (17:28 +0100)
committerLars Ingebrigtsen <larsi@gnus.org>
Fri, 3 Dec 2021 16:28:48 +0000 (17:28 +0100)
* lisp/calendar/time-date.el (date-to-time): The function needs to
test if `parse-time-string' returns a valid data as the old
version did it with the help of `encode-time' (bug#52209).

lisp/calendar/time-date.el

index 6407138953cab0ce7d838faf45d7cdc7ff7b22ad..8a6ee0f270257d63d4d34db1f1318bfd2f79e70d 100644 (file)
@@ -158,7 +158,10 @@ If DATE lacks timezone information, GMT is assumed."
   (encode-time
     (decoded-time-set-defaults
       (condition-case err
-          (parse-time-string date)
+          (let ((time (parse-time-string date)))
+            (prog1 time
+              ;; Cause an error if data `parse-time-string' returns is invalid.
+              (setq time (encode-time time))))
         (error
          (let ((overflow-error '(error "Specified time is not representable")))
            (if (or (equal err overflow-error)