comparison 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
comparison
equal deleted inserted replaced
106616:9fd36368ff9b 106617:78f92ffeb7ab
452 ;; FIXME: we don't correctly handle WKST here. 452 ;; FIXME: we don't correctly handle WKST here.
453 (if (and (string= freq "YEARLY") bymonth) 453 (if (and (string= freq "YEARLY") bymonth)
454 (cons 454 (cons
455 (concat 455 (concat
456 ;; Fake a name. 456 ;; Fake a name.
457 (if dst-p "(DST?)" "(STD?)") 457 (if dst-p "DST" "STD")
458 ;; For TZ, OFFSET is added to the local time. So, 458 ;; For TZ, OFFSET is added to the local time. So,
459 ;; invert the values. 459 ;; invert the values.
460 (if (eq (aref offset 0) ?-) "+" "-") 460 (if (eq (aref offset 0) ?-) "+" "-")
461 (substring offset 1 3) 461 (substring offset 1 3)
462 ":" 462 ":"
464 ;; The start time. 464 ;; The start time.
465 (let* ((day (icalendar--get-weekday-number (substring byday -2))) 465 (let* ((day (icalendar--get-weekday-number (substring byday -2)))
466 (week (if (eq day -1) 466 (week (if (eq day -1)
467 byday 467 byday
468 (substring byday 0 -2)))) 468 (substring byday 0 -2))))
469 ;; "Translate" the icalendar way to specify the last
470 ;; (sun|mon|...)day in month to the tzset way.
471 (if (string= week "-1") ; last day as icalendar calls it
472 (setq week "5")) ; last day as tzset calls it
469 (concat "M" bymonth "." week "." (if (eq day -1) "0" 473 (concat "M" bymonth "." week "." (if (eq day -1) "0"
470 (int-to-string day)) 474 (int-to-string day))
471 ;; Start time. 475 ;; Start time.
472 "/" 476 "/"
473 (substring dtstart -6 -4) 477 (substring dtstart -6 -4)
2239 ;; Note: diary-make-entry will add a trailing blank char.... :( 2243 ;; Note: diary-make-entry will add a trailing blank char.... :(
2240 (funcall (if (fboundp 'diary-make-entry) 2244 (funcall (if (fboundp 'diary-make-entry)
2241 'diary-make-entry 2245 'diary-make-entry
2242 'make-diary-entry) 2246 'make-diary-entry)
2243 string non-marking diary-file))) 2247 string non-marking diary-file)))
2248 ;; Würgaround to remove the trailing blank char
2249 (save-excursion
2250 (set-buffer (find-file diary-file))
2251 (goto-char (point-max))
2252 (if (= (char-before) ? )
2253 (delete-char -1)))
2244 ;; return diary-file in case it has been changed interactively 2254 ;; return diary-file in case it has been changed interactively
2245 diary-file) 2255 diary-file)
2246 2256
2247 ;; ====================================================================== 2257 ;; ======================================================================
2248 ;; Examples 2258 ;; Examples