>From b3e9fc879c8cadd8b634d7f4f3512ba1eaf1b8bf Mon Sep 17 00:00:00 2001 From: Matt Lundin Date: Fri, 6 Oct 2017 09:50:05 -0500 Subject: [PATCH] Fix interactive timestamp entry in capture templates * lisp/org-capture.el: (org-capture-fill-template) Fix interactive timestamp entry to match the behavior of org-time-stamp. This fixes a bug related to the %^t and %^u template escapes which resulted in incorrect timestamps (<2017-10-06 Fri-12:00>). The difference between %^t and %^T now corresponds to the difference between org-time-stamp called without and with a prefix argument. --- lisp/org-capture.el | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/lisp/org-capture.el b/lisp/org-capture.el index 862cdb276..25af674b8 100644 --- a/lisp/org-capture.el +++ b/lisp/org-capture.el @@ -1792,11 +1792,10 @@ The template may still contain \"%?\" for cursor positioning." (let* ((upcase? (equal (upcase key) key)) (org-end-time-was-given nil) (time (org-read-date upcase? t nil prompt))) - (let ((org-time-was-given upcase?)) - (org-insert-time-stamp - time org-time-was-given - (member key '("u" "U")) - nil nil (list org-end-time-was-given))))) + (org-insert-time-stamp + time (or org-time-was-given upcase?) + (member key '("u" "U")) + nil nil (list org-end-time-was-given)))) (`nil (push (org-completing-read (concat (or prompt "Enter string") -- 2.14.2