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.
This commit is contained in:
Nicolas Goaziou 2013-04-05 21:28:35 +02:00
parent 5fc6764c1f
commit 3d3465069b
1 changed files with 7 additions and 4 deletions

View File

@ -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)