From mboxrd@z Thu Jan 1 00:00:00 1970 From: =?utf-8?Q?R=C3=A9mi_Vanicat?= Subject: [PATCH] Allow iCalendar to use UTC for exported date-time. Date: Fri, 10 Sep 2010 16:58:15 +0200 Message-ID: <87pqwl4pdk.dlv@debian.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from [140.186.70.92] (port=59428 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Ou53g-0005gq-J3 for emacs-orgmode@gnu.org; Fri, 10 Sep 2010 10:58:33 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1Ou53b-0004ya-9S for emacs-orgmode@gnu.org; Fri, 10 Sep 2010 10:58:32 -0400 Received: from lo.gmane.org ([80.91.229.12]:40803) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Ou53b-0004yJ-3l for emacs-orgmode@gnu.org; Fri, 10 Sep 2010 10:58:27 -0400 Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1Ou53X-0001ff-9R for emacs-orgmode@gnu.org; Fri, 10 Sep 2010 16:58:23 +0200 Received: from 78.114.250.67 ([78.114.250.67]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 10 Sep 2010 16:58:23 +0200 Received: from vanicat by 78.114.250.67 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 10 Sep 2010 16:58:23 +0200 List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org 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 | 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) -- 1.7.1