What I’m trying to do
Hello fellow wanderers!
Previously in my “Daily Note”-Template I had a simple “date navigation links” templater code which worked fine.
Here:
<%* moment.locale(“de”) -%><[[<% tp.date.now(“YY-MM-DD”, -1, tp.file.title, “YY-MM-DD”) %>]] — [[<% tp.date.now(“YY-MM-DD”, 1, tp.file.title, “YY-MM-DD”) %>]]>
resulting in e.g.:
<[[24-01-09]] — [[24-01-11]]>
Since I am moving partially away from the regular daily note and work more in the weekly, I added the week note link (YY[W]ww)
in between. It works, as it generates the template BUT the “tomorrow’s date” is always the date of today:
<%* moment.locale(“de”) -%><[[<% tp.date.now(“YY-MM-DD”, -1, tp.file.title, “YY-MM-DD”) %>]] — [[<% tp.date.now(“YY[W]ww”), tp.file.title, “YY[W]ww”.format(“YY[W]ww”) %>]] — [[<% tp.date.now(“YY-MM-DD”, 1, tp.file.title, “YY-MM-DD”) %>]]>
resulting in e.g.:
<[[24-05-02]] — [[24W18]] — [[24-05-03]]>
where it should be:
<[[24-05-02]] — [[24W18]] — [[24-05-04]]>
I didn’t find any solution in the web or here in the forum regarding this specific issue. Appreciate any help!
Things I have tried
Following you’ll find some trials:
Not working
[[<% tp.date.now("YY[W]ww", 0, tp.file.title, "YY[W]ww") %>]]
[[<% tp.file.title("YY[W]ww").format("YY[W]ww") %>]]
[[<% tp.date.now("YY-MM-DD", tp.file.title, "YY[W]WW") %>]]
“week”/“weekday” - Not Working
[[<% tp.date.week("YY[W]ww"), tp.file.title, "YY[W]ww".format("YY[W]ww") %>]] [[<% tp.date.weekday("YY[W]ww"), tp.file.title, "YY[W]ww".format("YY[W]ww") %>]]
Creates The Right Week-Number “24W10”
[[<% moment(tp.file.title, "YY[W]ww").add(7, "weeks").format("YY[W]ww") %>]]
Produces “Invalid Date”
[[<% moment(tp.date.now("YY-MM-DD"), tp.file.title, "YY[W]ww").add(7, "weeks").format("YY[W]ww") %>]]
Produces the “correct” file, but only works for current week 24W10, following not (24W11)
[[<% tp.date.now("YY[W]ww"), tp.file.title, "YY[W]ww".format("YY[W]ww") %>]]
- Without “format” not working anymore
[[<% tp.date.now("YY[W]ww"), tp.file.title( "YY[W]ww") %>]]
- The “24W11” generated Week Note doesn’t bring any solution