diff lisp/calendar/icalendar.el @ 106617:78f92ffeb7ab

Fixed timezone handling problem in icalendar.el.
author Ulf Jasper <ulf.jasper@web.de>
date Fri, 18 Dec 2009 19:35:14 +0000
parents e667f4aad5f2
children 1d1d5d9bd884
line wrap: on
line diff
--- a/lisp/calendar/icalendar.el	Fri Dec 18 04:29:17 2009 +0000
+++ b/lisp/calendar/icalendar.el	Fri Dec 18 19:35:14 2009 +0000
@@ -454,7 +454,7 @@
 	    (cons
 	     (concat
 	      ;; Fake a name.
-	      (if dst-p "(DST?)" "(STD?)")
+	      (if dst-p "DST" "STD")
 	      ;; For TZ, OFFSET is added to the local time.  So,
 	      ;; invert the values.
 	      (if (eq (aref offset 0) ?-) "+" "-")
@@ -466,6 +466,10 @@
 		    (week (if (eq day -1)
 			      byday
 			    (substring byday 0 -2))))
+               ;; "Translate" the icalendar way to specify the last
+               ;; (sun|mon|...)day in month to the tzset way.
+               (if (string= week "-1")  ; last day as icalendar calls it
+                   (setq week "5"))     ; last day as tzset calls it
 	       (concat "M" bymonth "." week "." (if (eq day -1) "0"
 						  (int-to-string day))
 		       ;; Start time.
@@ -2241,6 +2245,12 @@
                    'diary-make-entry
                  'make-diary-entry)
                string non-marking diary-file)))
+  ;; Würgaround to remove the trailing blank char
+  (save-excursion
+    (set-buffer (find-file diary-file))
+    (goto-char (point-max))
+    (if (= (char-before) ? )
+        (delete-char -1)))
   ;; return diary-file in case it has been changed interactively
   diary-file)