[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [O] counter macro in dates?
From: |
Adam Porter |
Subject: |
Re: [O] counter macro in dates? |
Date: |
Wed, 23 Aug 2017 01:27:20 -0500 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/25.2 (gnu/linux) |
Matt Price <address@hidden> writes:
> I'd love to be able generate dates dynamically using the {{{n}}} org
> macro, or some other mechanism. I don't immediately see how that would
> be possible but maybe someone can guide me. I'd want to do something
> equivalent to this pseudo-elisp:
>
> (let ((base-date 2017-09-05))
> (+ base-date (* 7 {{{n}}}))
>
> I haven't looked into how date objects are parsed in org-mode, though,
> so I have no idea how hard it would be to actually implement something
> like this.
Apologies to the list for practically spamming this recently, but it
seems directly relevant:
https://github.com/abo-abo/tiny
It has built-in support for Org dates with its %(date) function.
Apparently it can be used like this:
m\n8|**** TODO Learning from Data Week %(+ x 2) \nSCHEDULED: <%(date "Oct 7" (*
x 7))> DEADLINE: <%(date "Oct 14" (* x 7))>
Which results in:
**** TODO Learning from Data Week 2
SCHEDULED: <2013-10-07 Mon> DEADLINE: <2013-10-14 Mon>
**** TODO Learning from Data Week 3
SCHEDULED: <2013-10-14 Mon> DEADLINE: <2013-10-21 Mon>
[...]