>From f8de6c716e892e159f80d40d91737ff8ac983877 Mon Sep 17 00:00:00 2001 From: Rasmus Date: Sun, 8 Feb 2015 21:34:43 +0100 Subject: [PATCH 2/2] * ox.el: Allow {{{date}}} formatting * ox.el (org-export-as): Allow {{{date}}} to take formatting-argument. With optional argument, {{{date(FMT)}}} works like {{{time(FMT)}}} if \#+DATE is a timestamp. --- lisp/ox.el | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/lisp/ox.el b/lisp/ox.el index ad3742c..baaab6b 100644 --- a/lisp/ox.el +++ b/lisp/ox.el @@ -2872,7 +2872,18 @@ Return code as a string." (list (cons "author" (org-element-interpret-data (plist-get info :author))) (cons "date" - (org-element-interpret-data (plist-get info :date))) + (let* ((date (plist-get info :date)) + (date-string (org-element-interpret-data date))) + ;; Interpret only single time-stamps. + (case (and (not (cdr date)) + (org-element-type (car date))) + (timestamp + (format + "(eval (if (org-element-property :args macro) + (org-export-get-date info \"$1\") + \"%s\"))" + date-string)) + (t date-string)))) ;; EMAIL is not a parsed keyword: store it as-is. (cons "email" (or (plist-get info :email) "")) (cons "title" -- 2.3.0