I am trying to create an agenda search that matches on the DATE
property of certain entries.
This works fine for one-off tasks/events; however, when I have a repeating task whose DATE
is of the form <some-ancient-date +1w>
, running a search like
DATE>"<now>"+DATE<"<tomorrow>"
to get my upcoming events for today doesn't capture this task because its DATE
value is the date at which I first defined this task. How can I modify my query to capture the fact that this event is supposed to recur today?
Minimal Working Example
Suppose my agenda file has the following entries:
* Receive Nobel prize
:PROPERTIES:
:DATE: <2019-06-04 10:00>
:END:
* Floss
:PROPERTIES:
:DATE: <2019-01-01 7:30 +1d>
:END:
And I have set up my init.el
with
(setq org-agenda-custom-commands
'(("d" "Day's events"
((tags "DATE>=\"<now>\"+DATE<\"<tomorrow>\""
((org-agenda-overriding-header "Today's events")))))))
Exepcted output
When I press C-c C-a d
(assuming today is June 4, 2019), I expect to see
Today's events
agenda: Receive Nobel prize
agenda: Floss
Actual output
Today's events
agenda: Receive Nobel prize
I think this is because the matcher looks at the date at which the recurring task was defined and does not actually do the math to realize that it's supposed to recur today. My question is, can I force the matcher to somehow do this math? I think this should be easy considering that the day view of the agenda has that information, I just don't know how to go about it.
Aside Please let's not quibble over the fact that "Floss" is not an event but a habit and that I shouldn't be reporting it in my agenda this way: my actual use case has a recurring event where it makes sense for me to report it like this.
A (non-ideal) workaround
One way to overcome this problem is to convert this headline to a TODO
item and use the SCHEDULED
property instead of the date property. This way, every time you mark the task as DONE
(or any other "finished" state), your SCHEDULED
property will get updated with the next date and you can match on that quite easily. The problem is, my use case is for an optional recurring event that I may or may not want to attend. I don't want it to appear as a TODO
item in my agenda and get automatically carried over to the next day if I don't mark it DONE
.