I'm trying to create an org-capture
template that contains dates relative to the value of %t
. I understand that with C-1
I can prompt for a particular date, and I'm looking for the day prior and the Friday after. I got this far, but now it seems to take today's date, not the particular date selected in the org-capture modal:
(org-read-date nil nil "-1" nil (org-time-string-to-time "%t"))
(org-read-date nil nil "+fri" nil (org-time-string-to-time "%t"))
I also struggled with the "+fri"
, which seems to return the Friday after the date. I was hoping to have the particular date if that particular date is a Friday.
%t
is either replaced by the current time (if you callorg-capture
) or it is replaced by whatever time stamp is at point in the current buffer (if you callorg-agenda-capture
). AFAICT, there is no prompting, i.e. you cannot enter a time interactively.%^t
- however, filling in values interactively is the last step in template expansion, so I don't think you can get the value, manipulate it and insert it back into the template for further expansion. It may be possible through lisp expressions in the template, but the whole thing seems fragile to me. An example of what exactly you are trying to accomplish (i.e. an example of an entry that the capture template is supposed to create) would go a long way towards clarifying the question and possibly enabling either a solution or suggestions for another way.:time-prompt
would allow me to prompt for a datetime other than use the current or the datetime at point. The below answer comes very close to what I was looking for. Thank you again!