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> 2014-07-22 Christer Ekholm <che@chrekh.se>
Fix bug 1701: Fix bug 1701:
......
...@@ -1302,7 +1302,7 @@ Args: TEXT-STAT of the text being read." ...@@ -1302,7 +1302,7 @@ Args: TEXT-STAT of the text being read."
(defun lyskom-mx-date-to-time (mx-date) (defun lyskom-mx-date-to-time (mx-date)
(when 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)) (now (decode-time))
(sec (or (elt date 0) 0)) (sec (or (elt date 0) 0))
(min (or (elt date 1) 0)) (min (or (elt date 1) 0))
...@@ -1312,17 +1312,19 @@ Args: TEXT-STAT of the text being read." ...@@ -1312,17 +1312,19 @@ Args: TEXT-STAT of the text being read."
(year (or (elt date 5) (elt now 5))) (year (or (elt date 5) (elt now 5)))
(wday (elt date 6)) (wday (elt date 6))
(dst (elt date 7)) (dst (elt date 7))
(zone (elt date 8))) (zone (elt date 8))
(setq date (if kom-show-mx-date-as-local (convdate (decode-time (encode-time sec min hour day month year wday dst zone))))
(decode-time (encode-time sec min hour day month year wday dst zone)) (setq date
(list sec min hour day month year wday dst zone))) (if kom-show-mx-date-as-local
convdate
(list sec min hour day month year wday dst zone)))
(lyskom-create-time (elt date 0) (lyskom-create-time (elt date 0)
(elt date 1) (elt date 1)
(elt date 2) (elt date 2)
(elt date 3) (elt date 3)
(elt date 4) (elt date 4)
(elt date 5) (elt date 5)
(elt date 6) (or (elt date 6) (elt convdate 6))
0 0
(elt date 7) (elt date 7)
(elt date 8))))) (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