diff options
author | RĂ©mi Vanicat <vanicat@debian.org> | 2010-09-10 19:58:15 +0000 |
---|---|---|
committer | Carsten Dominik <carsten.dominik@gmail.com> | 2010-09-14 14:05:31 +0200 |
commit | 2ad802968bea056eecf9d809c535ee40856320b9 (patch) | |
tree | b244aa59ffb523f98092d894ad0fd0065e0ef0d7 | |
parent | 2a688e9aebb898723e4016b535dbdffa5b2cb86e (diff) | |
download | org-mode-2ad802968bea056eecf9d809c535ee40856320b9.tar.gz |
Allow iCalendar to use UTC for exported date-time.
Define a new variable org-icalendar-use-UTC-date-time that when
non-nil make icalendar exporter to use UTC date-time for better
compatibility with some other software (as GCALDaemon).
* lisp/org-icalendar.el (org-icalendar-use-UTC-date-time): New option.
(org-ical-ts-to-string): Use UTC time when requested.
-rw-r--r-- | lisp/org-icalendar.el | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/lisp/org-icalendar.el b/lisp/org-icalendar.el index c374e2e..1e3c798 100644 --- a/lisp/org-icalendar.el +++ b/lisp/org-icalendar.el @@ -194,6 +194,13 @@ When nil of the empty string, use the abbreviation retrieved from Emacs." (const :tag "Unspecified" nil) (string :tag "Time zone"))) +(defcustom org-icalendar-use-UTC-date-time () + "Non-nil force the use of the universal time for iCalendar DATE-TIME. +The iCalendar DATE-TIME can be expressed with local time or universal Time, +universal time could be more compatible with some external tools." + :group 'org-export-icalendar + :type 'boolean) + ;;; iCalendar export ;;;###autoload @@ -634,8 +641,13 @@ a time), or the day by one (if it does not contain a time)." (setq h (+ 2 h))) (setq d (1+ d)))) (setq time (encode-time s mi h d m y))) - (setq fmt (if have-time ":%Y%m%dT%H%M%S" ";VALUE=DATE:%Y%m%d")) - (concat keyword (format-time-string fmt time))))) + (setq fmt (if have-time (if org-icalendar-use-UTC-date-time + ":%Y%m%dT%H%M%SZ" + ":%Y%m%dT%H%M%S") + ";VALUE=DATE:%Y%m%d")) + (concat keyword (format-time-string fmt time + (and org-icalendar-use-UTC-date-time + have-time)))))) (provide 'org-icalendar) |