From 3d3465069be8b602d7b78d95d99482759392ae56 Mon Sep 17 00:00:00 2001 From: Nicolas Goaziou Date: Fri, 5 Apr 2013 21:28:35 +0200 Subject: [PATCH] ox-icalendar: Fix DTSTAMP property value * lisp/ox-icalendar.el (org-icalendar-convert-timestamp): Update docstring. (org-icalendar-dtstamp): New function. (org-icalendar--vevent, org-icalendar--vtodo): Use new function. --- lisp/ox-icalendar.el | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/lisp/ox-icalendar.el b/lisp/ox-icalendar.el index 5626a01fa..00055d25e 100644 --- a/lisp/ox-icalendar.el +++ b/lisp/ox-icalendar.el @@ -360,8 +360,7 @@ or the day by one (if it does not contain a time) when no explicit ending time is specified. When optional argument UTC is non-nil, time will be expressed in -Universal Time, ignoring `org-icalendar-date-time-format'. -This is mandatory for \"DTSTAMP\" property." +Universal Time, ignoring `org-icalendar-date-time-format'." (let* ((year-start (org-element-property :year-start timestamp)) (year-end (org-element-property :year-end timestamp)) (month-start (org-element-property :month-start timestamp)) @@ -406,6 +405,10 @@ This is mandatory for \"DTSTAMP\" property." (encode-time 0 mi h d m y) (or utc (and with-time-p (org-icalendar-use-UTC-date-time-p))))))) +(defun org-icalendar-dtstamp () + "Return DTSTAMP property, as a string." + (format-time-string "DTSTAMP:%Y%m%dT%H%M%SZ" nil t)) + (defun org-icalendar-get-categories (entry info) "Return categories according to `org-icalendar-categories'. ENTRY is a headline or an inlinetask element. INFO is a plist @@ -644,7 +647,7 @@ Return VEVENT component as a string." (org-icalendar-transcode-diary-sexp (org-element-property :raw-value timestamp) uid summary) (concat "BEGIN:VEVENT\n" - (org-icalendar-convert-timestamp timestamp "DTSTAMP" nil t) "\n" + (org-icalendar-dtstamp) "\n" "UID:" uid "\n" (org-icalendar-convert-timestamp timestamp "DTSTART") "\n" (org-icalendar-convert-timestamp timestamp "DTEND" t) "\n" @@ -690,7 +693,7 @@ Return VTODO component as a string." (org-icalendar-fold-string (concat "BEGIN:VTODO\n" "UID:TODO-" uid "\n" - (org-icalendar-convert-timestamp start "DTSTAMP" nil t) "\n" + (org-icalendar-dtstamp) "\n" (org-icalendar-convert-timestamp start "DTSTART") "\n" (and (memq 'todo-due org-icalendar-use-deadline) (org-element-property :deadline entry)