Change Dataview Code in Template for Daily Note, date be persistent

What I’m trying to do

I have Templater, Dataview. I have a Template for my daily notes that includes queries that show the newly created Tasks and files of the day with this code:

LIST
WHERE file.cday = date(today)

And

TASK
WHERE
created = date(today)

My problem is, i would like to have this like a log entry, so if i open the file of a day in the past, I want to see what I added that day.

Currently, every file i open shows todays created stuff.
Well yes, this seems logical.
But I dont know how to alter the code to do what I want. I would use javascript, but am clueless.

Thanks Hivemind!

this templater code will bake in the day of creation
<% tp.date.now("YYYY-MM-DD") %>

this will use the filename as a date value, if your day notes are iso format
<% tp.date.now("YYYY-MM-DD",0, tp.file.title, "YYYY-MM-DD") %>
you can change that 0 to -1 for yesterday, 1 for tomorrow, etc

1 Like

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.