Automatically create Yesterday, Today, and Tomorrow Daily note links in the Daily Template

Hello fellow Obsidians, I’m still in the early stages of getting templatized and such.

Things I have tried

I searched the help and the time reference but i’m in the dark as to how to use “time to x” or “calendar time”.

What I’m trying to do

I’d like to have the daily note create a linked entry for the current date (which I accomplished with [[{{date:YYYY.MM.DD, dddd}}]]) but I’d like to also have a link to yesterday’s entry and tomorrow’s entry, all made automatically. Maybe even a link to 7 days forward an 7 days back as well.

Any help is greatly appreciated! Thanks fam.

1 Like

I use the following in various templates:

[[<% tp.date.now("DD.MMMM.YYYY", -1) %>|Yesterday]]
[[<% tp.date.now("DD.MMMM.YYYY", +1) %>|Tomorrow]]
[[Week <% tp.date.now("WW")%> of <%tp.date.now("yyyy")%>|This Week]]
[[<% tp.date.now("00M-" + "MMMM-YYYY") %>|This Month]]
[[Q<%tp.date.now("Q")%> of <%tp.date.now("yyyy")%>|This Quarter]]
[[Year of <% tp.date.now("yyyy") %> |This Year]]
4 Likes

Thanks. Id there a reason you didn’t use tp.date.yesterday/tomorrow functions?

There’s another thread on a similar topic here. It went from the Yesterday / Tomorrow links to highlighting that most work related vaults don’t have weekend entries.

I’m no expert, but with some tinkering I came up with some JS wrapped Templater code (2nd post in the linked thread) to skip weekends which works off of the note file name. That way I can use Daily-Note or create a note after the fact, and still have its links correctly find the previous/next (working) days.

2 Likes

thanks. will give it a try.

I appreciate the effort. I tried using this but it didn’t work for me. Does this code require any plugin turned on or headers or something?

In my Daily notes settings I use YYYY.MM.DD, dddd as my format. I’m not sure what the date.now stuff is calling from. I guess I need to know more about how the programming is organized. I feel like I’m starting from the middle chapter in a book.

Yes, I failed to mention that this syntax requires the plugin Templater.

1 Like

Oh, okay. Now that makes more sense.
I’ll have to try a different approach since I’m not willing to use Templater at this time. (I’m still figuring out how to check plugins for security concerns.)

Thanks for the feedback!

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