Traversing Weekly Notes in Obsidian with Templater

Result

<< [[2022-W30]] | [[2022-W32]] >>

Implementation

If you create Weekly Notes on Sunday, the template should have the following structure:

<< [[<% tp.date.now("YYYY") %>-W<% tp.date.now("WW") - -1%>]] | [[<% tp.date.now("YYYY") %>-W<% tp.date.now("WW") - -3 %>]] >>

If you create Weekly Notes on Monday, the template should have the following structure:

<< [[<% tp.date.now("YYYY") %>-W<% tp.date.now("WW") %>]] | [[<% tp.date.now("YYYY") %>-W<% tp.date.now("WW") - -2 %>]] >>

Why?

As far as I can tell, tp.date.now("WW") changes on Monday. Posts like this seem to imply that moment.js (the library that powers tp.date) also thinks weeks start on Sunday and end Saturday, but in my own testing with .now() that does not seem to be the case.

Sunday -> tp.date.now("WW") = 29

Tuesday (i forgot to run this on Monday, sue me) -> tp.date.now("WW") = 30

In addition, templater ignores "+" meaning you have to subtract negative numbers to get the desired result, which explains the "- -1" and "- -3" above.

Summary

Read These Next

My Favorite Blender Render Ive Created (To Date)

We say we want peace of mind when we really want peace from mind. - Naval Ravikant

Ezra Miller has Cheat Codes Enabled

Ah shit, here we go again

Stay in Touch

Each week, I send out something that looks like this. Sign up below if you want in!