Browse Source

Fix bug in org-capture file+datetree+promt target type

* lisp/org-capture.el (org-capture-set-target-location): Set the capture
default time also to the prompt time.

In the file+datetree+promt target type, the user is being asked for a
date, where to file an entry.  In the template, there can the escape
placeholders for active and inactive time stamps.  So far, these were
filled with todays date.  This patch changes this behavior, so that
also at %t and %u escaped, the date entered at the prompt will be

Reported by Erik Hetzner.
Carsten Dominik 6 years ago
1 changed files with 2 additions and 1 deletions
  1. 2 1

+ 2 - 1

@@ -778,7 +778,8 @@ already gone.  Any prefix argument will be passed to the refile command."
 	    (let ((prompt-time (org-read-date
 				nil t nil "Date for tree entry:"
-	      (org-capture-put :prompt-time prompt-time)
+	      (org-capture-put :prompt-time prompt-time
+			       :default-time prompt-time)
 	      (time-to-days prompt-time)))
 	    ;; current date, possible corrected for late night workers