summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBastien Guerry <bzg@altern.org>2013-03-15 13:15:32 (GMT)
committer Bastien Guerry <bzg@altern.org>2013-03-15 13:15:32 (GMT)
commit4eba81e5f41273c400d67409c79b5881cd39237a (patch)
tree27e82f88676809de42b70e40afb63afa035d8fe2
parentce0473532d005b259489447ddaccea9b9c3abc57 (diff)
downloadorg-mode-4eba81e5f41273c400d67409c79b5881cd39237a.zip
org-mode-4eba81e5f41273c400d67409c79b5881cd39237a.tar.gz
ox-html.el: Enhance date insertion
* ox-html.el (org-html--build-postamble): Default to today's date. (org-html--build-meta-info): When #+DATE contains a time stamp, parse it as a RFC 822 time string, otherwise simply insert the date as a string.
-rw-r--r--lisp/ox-html.el14
1 files changed, 11 insertions, 3 deletions
diff --git a/lisp/ox-html.el b/lisp/ox-html.el
index a3c6852..7c9927c 100644
--- a/lisp/ox-html.el
+++ b/lisp/ox-html.el
@@ -1404,7 +1404,12 @@ INFO is a plist used as a communication channel."
(and auth (org-export-data auth info)))))
(date (and (plist-get info :with-date)
(let ((date (plist-get info :date)))
- (and date (org-export-data date info)))))
+ (if (eq (org-element-type (car date)) 'timestamp)
+ (format-time-string
+ "%a, %d %h %Y %H:%M:%S %Z" ;; RFC 822
+ (org-time-string-to-time
+ (org-element-property :raw-value (car date))))
+ (car date)))))
(description (plist-get info :description))
(keywords (plist-get info :keywords)))
(concat
@@ -1511,8 +1516,11 @@ INFO is a plist used as a communication channel."
(when postamble
(let ((postamble-contents
(if (functionp postamble) (funcall postamble info)
- (let ((date (if (not (plist-get info :with-date)) ""
- (org-export-data (plist-get info :date) info)))
+ (let ((date (org-export-data
+ (or (plist-get info :date)
+ (substring (format-time-string
+ (car org-time-stamp-formats)) 1 -1))
+ info))
(author (let ((author (plist-get info :author)))
(and author (org-export-data author info))))
(email (mapconcat