Commit fd108eaf authored by Christer Ekholm's avatar Christer Ekholm

Fix bug introduced in comit ee028db4.

The "(decode-time (encode-time" combination must not be used unless
kom-show-mx-date-as-local and must be used on "safe" values, not
directly on the result from parse-time-string.
parent ee028db4
2014-07-23 Christer Ekholm <che@chrekh.se>
* view-text.el (lyskom-mx-date-to-time): Fix bug introduced with
last commit. The "(decode-time (encode-time" combination must not
be used unless kom-show-mx-date-as-local and must be used on
"safe" values, not directly on the result from parse-time-string.
2014-07-22 Christer Ekholm <che@chrekh.se>
Fix bug 1701:
......
......@@ -1302,7 +1302,7 @@ Args: TEXT-STAT of the text being read."
(defun lyskom-mx-date-to-time (mx-date)
(when mx-date
(let* ((date (decode-time (apply 'encode-time (parse-time-string (aux-item->data mx-date)))))
(let* ((date (parse-time-string (aux-item->data mx-date)))
(now (decode-time))
(sec (or (elt date 0) 0))
(min (or (elt date 1) 0))
......@@ -1312,9 +1312,11 @@ Args: TEXT-STAT of the text being read."
(year (or (elt date 5) (elt now 5)))
(wday (elt date 6))
(dst (elt date 7))
(zone (elt date 8)))
(setq date (if kom-show-mx-date-as-local
(decode-time (encode-time sec min hour day month year wday dst zone))
(zone (elt date 8))
(convdate (decode-time (encode-time sec min hour day month year wday dst zone))))
(setq date
(if kom-show-mx-date-as-local
convdate
(list sec min hour day month year wday dst zone)))
(lyskom-create-time (elt date 0)
(elt date 1)
......@@ -1322,7 +1324,7 @@ Args: TEXT-STAT of the text being read."
(elt date 3)
(elt date 4)
(elt date 5)
(elt date 6)
(or (elt date 6) (elt convdate 6))
0
(elt date 7)
(elt date 8)))))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment