summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBastien Guerry <bzg@altern.org>2013-03-19 10:35:50 +0100
committerBastien Guerry <bzg@altern.org>2013-03-19 10:35:50 +0100
commit6155faa84bb98759efa0314dc663b104400ec9f7 (patch)
treeca12a89b921f4d94fb5d34750018c4adf3bcbcfe
parent1e916b72937c99f093380503027b5c1d92c6b6cb (diff)
downloadorg-mode-6155faa84bb98759efa0314dc663b104400ec9f7.tar.gz
ox-rss.el: Set the PUBDATE property value as an Org time-stamp
* ox-rss.el (org-rss-headline): Convert the PUBDATE property value to a RFC 822 time string. (org-rss-add-pubdate-property): Set the PUBDATE property value as an Org time-stamp, so that users can edit it easily.
-rw-r--r--contrib/lisp/ox-rss.el13
1 files changed, 9 insertions, 4 deletions
diff --git a/contrib/lisp/ox-rss.el b/contrib/lisp/ox-rss.el
index cf2d79e..c5dbc8e 100644
--- a/contrib/lisp/ox-rss.el
+++ b/contrib/lisp/ox-rss.el
@@ -233,7 +233,13 @@ communication channel."
(concat "sec-" (mapconcat 'number-to-string hl-number "-")))))
(category (org-rss-plain-text
(or (org-element-property :CATEGORY headline) "") info))
- (pubdate (org-element-property :PUBDATE headline))
+ (pubdate
+ (let ((system-time-locale "C"))
+ (format-time-string
+ "%a, %d %h %Y %H:%M:%S %Z"
+ (org-time-string-to-time
+ (or (org-element-property :PUBDATE headline)
+ (error "Missing PUBDATE property"))))))
(title (org-rss-plain-text
(org-element-property :raw-value headline) info))
(publink
@@ -383,9 +389,8 @@ information."
(unless (org-entry-get (point) "PUBDATE")
(setq msg t)
(org-set-property
- "PUBDATE"
- (let ((system-time-locale "C"))
- (format-time-string "%a, %d %h %Y %H:%M:%S %Z")))))))
+ "PUBDATE" (format-time-string
+ (cdr org-time-stamp-formats)))))))
nil nil 'comment 'archive)
(when msg
(message "Property PUBDATE added to top-level entries in %s"