From 4eba81e5f41273c400d67409c79b5881cd39237a Mon Sep 17 00:00:00 2001 From: Bastien Guerry Date: Fri, 15 Mar 2013 14:15:32 +0100 Subject: [PATCH] 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. --- lisp/ox-html.el | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/lisp/ox-html.el b/lisp/ox-html.el index a3c68527e..7c9927c88 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