summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatt Lundin <mdl@imapmail.org>2017-10-06 09:50:05 -0500
committerNicolas Goaziou <mail@nicolasgoaziou.fr>2017-10-06 19:13:57 +0200
commitce536f637554c630ae81598bca2481c01fa3d697 (patch)
tree68fc7cbce9d7412fa06fcebda82d91f310799c0d
parent710a3d1131bdf49545b67083c27036e38ab3c6e1 (diff)
downloadorg-mode-ce536f637554c630ae81598bca2481c01fa3d697.tar.gz
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.
-rw-r--r--lisp/org-capture.el9
1 files changed, 4 insertions, 5 deletions
diff --git a/lisp/org-capture.el b/lisp/org-capture.el
index 862cdb2..25af674 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")