What I’m trying to do
I want to replicate the logic from having a Prev | Next navigation from this Daily template, and applied the same concept on my Weekly template.
Things I have tried
This works for the Daily template
CODE:
⬅️ [[<% moment(tp.file.title, "YYYY-MM-DD").subtract(1, "days").format("YYYY-MM-DD") %>]] | [[<% moment(tp.file.title, "YYYY-MM-DD").add(1, "days").format("YYYY-MM-DD") %>]] ➡️
OUTPUT:
Now … for the weekly template I’ve been spend 1-2 hours on it but can’t see how to make it work. The output I’m looking for is:
[[2023-W39]] | [[2023-W41]]
So far I tried :
TAKE 1:
<% tp.date.now("gggg-[W]ww").add(1, "weeks").format("gggg-[W]ww") %>
<% tp.date.now("gggg-[W]ww").subtract(1, "weeks").format("gggg-[W]ww") %>
TAKE 2:
<% tp.date.now("gggg-[W]ww", -1) %>
<% tp.date.now("gggg-[W]ww", 1) %>
TAKE 3:
<< [[<% tp.date.now("YYYY") %>-W<% tp.date.now("WW") - -1%>]] | [[<% tp.date.now("YYYY") %>-W<% tp.date.now("WW") - -3 %>]] >>
I also asked chatgpt, but nope :-/
Thanks for you help