The individual pieces work outside of the link and render the correct string. I’m not sure why they don’t work inside the link.
I would appreciate any pointers!
I’m also not sure why, but they don’t seem to work without the + right after the %. Maybe that is related? With the + the code doesn’t render to anything and just displays as text.
I tried it on my machine. I couldn’t get it to work WITH the + signs. If I used [[The Lab/Weekly/<%moment(tp.file.title).format("MMMM")%>/<%moment(tp.file.title).subtract(1,'week').format("gggg-[W]ww")%>|<-- Previous Week]] (note no plus signs), then I got
[[The Lab/Weekly/May/2024-W21|<-- Previous Week]]
in a note with a name “2024-05-28”. W21 is the correct week. Adding the plus gave NaN’s instead of strings for the values. I wonder if the “+” gets associated with the ‘<%’ and that screws things up.
I have tried it that way as well, in fact I started that way and when it wasn’t working I went googling for help and I found someone that said adding +'s worked for them and it seemed to work for me…I’m not really sure what else to try? I’ve tried various symbols, spaces, no spaces, disabling/deleting Templater and Periodic Notes and then reinstalling, disabling, enabling Daily Notes and Templates core plugins…