What I’m trying to do
I’m using periodic notes and templater to set up a weekly note system. I’m having trouble setting up “previous/next week” links. The way I wrote the links, it keeps me linking to the previous and next week, but always referred to week 1 of the year, no matter what the actual week
Things I have tried
So this is what I wrote in the weekly note template (templated used for the periodic note plugin)
<% tp.date.weekday("gggg-[W]ww-MMM", -7, tp.file.title, "gggg-[W]ww-MMM") %>|«Prev]] | [[Organizing/Agenda/Calendar/Weekly Notes/<% tp.date.weekday("gggg-[W]ww-MMM", +7, tp.file.title, "gggg-[W]ww-MMM") %>|Next»]]
as you can see, my week format is “gggg-[W]ww-MMM”, and the file title of the weekly note is just the same.
tp.file.title function seems to work properly , as I tested adding the following line in the note template:
<% tp.file.title %>
and it returns the expected result (at the time of writing, it returns “2025-W04-Jan”)
But, testing with the following line, it doesn’t return the expected result:
<% tp.date.now("gggg-[W]ww-MMM", 0, tp.file.title, "gggg-[W]ww-MMM") %>
I expected to return, once again “2025-W04-Jan”, instead it returns “2025-W01-Jan”
I figure the problem with the previous/next links originates here, since the links I wrote on the template, return links for 2024-W52-Dec and 2025-W02-Jan, so the offset is correct, the problem is it calculates it from 2025-W01-Jan