summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBastien Guerry <bzg@altern.org>2011-02-12 21:15:06 +0100
committerBastien Guerry <bzg@altern.org>2011-02-12 21:15:06 +0100
commitf956c242f3469e38c3006584b238b413d0db4822 (patch)
treede296fbfd7744675193f1670c0466a0f951dfab9
parentd1a60922330b1fb9bebc0c25dea53f3fa45e7ef1 (diff)
downloadorg-mode-f956c242f3469e38c3006584b238b413d0db4822.tar.gz
Make org-icalendar-date-time-format backward compatible.
-rw-r--r--lisp/org-icalendar.el30
1 files changed, 19 insertions, 11 deletions
diff --git a/lisp/org-icalendar.el b/lisp/org-icalendar.el
index ad2482d..9be0ae0 100644
--- a/lisp/org-icalendar.el
+++ b/lisp/org-icalendar.el
@@ -199,10 +199,15 @@ When nil of the empty string, use the abbreviation retrieved from Emacs."
(const :tag "Unspecified" nil)
(string :tag "Time zone")))
-(defcustom org-icalendar-date-time-format ":%Y%m%dT%H%M%S"
- "format-string for exporting icalendar DATE-TIME.
-See `format-time-string' for a full documentation. The only
-difference is that `org-icalendar-timezone' is used for %Z
+;; Backward compatibility with previous variable
+(defvar org-icalendar-use-UTC-date-time nil)
+(defcustom org-icalendar-date-time-format
+ (if org-icalendar-use-UTC-date-time
+ ":%Y%m%dT%H%M%SZ"
+ ":%Y%m%dT%H%M%S")
+ "Format-string for exporting icalendar DATE-TIME.
+See `format-time-string' for a full documentation. The only
+difference is that `org-icalendar-timezone' is used for %Z.
Interesting value are:
- \":%Y%m%dT%H%M%S\" for local time
@@ -216,8 +221,9 @@ Interesting value are:
(const :tag "Universal time" ":%Y%m%dT%H%M%SZ")
(string :tag "Explicit format")))
-(defun org-icalendar-use-UTC-date-timep ()
- (char-equal (elt org-icalendar-date-time-format (1- (length org-icalendar-date-time-format))) ?Z))
+(defun org-icalendar-use-UTC-date-timep ()
+ (char-equal (elt org-icalendar-date-time-format
+ (1- (length org-icalendar-date-time-format))) ?Z))
;;; iCalendar export
@@ -376,7 +382,7 @@ When COMBINE is non nil, add the category to each line."
(throw :skip t))
;; don't export entries with a :noexport: tag
(when (and org-icalendar-honor-noexport-tag
- (delq nil (mapcar (lambda(x)
+ (delq nil (mapcar (lambda(x)
(member x org-export-exclude-tags)) tags)))
(throw :skip t))
(when (and
@@ -411,7 +417,7 @@ When COMBINE is non nil, add the category to each line."
;; (c) only a DISPLAY action is defined.
;; [ESF]
(let ((t1 (ignore-errors (org-parse-time-string ts 'nodefault))))
- (if (and (> org-icalendar-alarm-time 0)
+ (if (and (> org-icalendar-alarm-time 0)
(car t1) (nth 1 t1) (nth 2 t1))
(setq alarm (format "\nBEGIN:VALARM\nACTION:DISPLAY\nDESCRIPTION:%s\nTRIGGER:-P0D0H%dM0S\nEND:VALARM" summary org-icalendar-alarm-time))
(setq alarm ""))
@@ -665,10 +671,12 @@ 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
- (replace-regexp-in-string "%Z" org-icalendar-timezone org-icalendar-date-time-format)
+ (setq fmt (if have-time
+ (replace-regexp-in-string "%Z"
+ org-icalendar-timezone
+ org-icalendar-date-time-format)
";VALUE=DATE:%Y%m%d"))
- (concat keyword (format-time-string fmt time
+ (concat keyword (format-time-string fmt time
(and (org-icalendar-use-UTC-date-timep)
have-time))))))