Fix regression introduced by the previous date-to-time change
* 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).
This commit is contained in:
parent
85e56d97b7
commit
32a8b3bc22
1 changed files with 4 additions and 1 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Reference in a new issue