1

For a capture template I want to insert inactive dates for the upcoming week (without a prompt). In this format (no time component):

[2020-02-10 Mo]

I've figured out that I could do something like this
[%(org-read-date nil nil "Tue")] which yields [2020-02-11]. So it misses the weekday.

I also know about this method
(org-insert-time-stamp (org-read-date nil t "+1d")) but that timestamp is not inactive.

Drew
  • 75,699
  • 9
  • 109
  • 225
sebastian
  • 417
  • 3
  • 9

1 Answers1

2

I was close with my last try.
Reading the documentation does help :)

%(org-insert-time-stamp (org-read-date nil t "+1d") nil t)
does the trick. And you can do any date arithmetic in the string part that you would do at the interactive prompt.

sebastian
  • 417
  • 3
  • 9
  • Hey Sebstian, what ist the "%" sign for? – breathe_in_breathe_out Apr 11 '22 at 11:55
  • @breathe_in_breathe_out if you want to execute custom code in a capture template you have to prefix it with the %-sign. There are many possible template expansions and `%(EXP)` is one of them. For a detailed overview see https://orgmode.org/manual/Template-expansion.html – sebastian Apr 11 '22 at 13:06