Templater - date from note name

I’m using this snippet in my daily template:

Previous:: [[<% tp.date.now("YYYY-MM-DD", -1) %>]]
Next:: [[<% tp.date.now("YYYY-MM-DD", +1) %>]]

I would like to use “Tomorrow’s Daily Note” plugin (obsidian://show-plugin?id=obsidian-tomorrows-daily-note) and that doesn’t work well since tp.date.now is not what is needed.

That would require extracting date from the note name (tp.file.title, I suppose).
What would be the prettiest solution?

Solved this.

From documentation, third parameter for tp.date.now is the reference date. All I had to do is set it to note title:

Previous:: [[<% tp.date.now("YYYY-MM-DD", -1, tp.file.title) %>]]
Next:: [[<% tp.date.now("YYYY-MM-DD", +1, tp.file.title) %>]]
1 Like

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