I would like to generate dates in my weekly notes based on the filename which is handled by Periodic Notes such that I can create weekly notes in advance or retrosperspectively through the calendar plug-in.
I do the same in my daily note with the following command:
Moment isn’t parsing your input date format correctly.
It works through the tokens from left to right, so for W-2024-02-07 and matching string [W]-YYYY-MM-WW:
It builds the date object from
2024 year
02 month
07 week
In Step 2, moment assigns the date to be the first of the month.
Then, for some reason, it doesn’t like the combination of finding the day from the week token in Step 3 after the month has been parsed. There may be a reason for this or a bug at the moment.
Resolution
Just don’t parse the month in your string [W]-YYYY-[MM]-WW.
The solution by @evank is correct, thanks a lot!
If anyone would like to have the header of a weekly note including navigation to previous and next week:
Do note that using a format like you do here, will also make dataview confused since your example title will be interpreted by default as february 7th, 2024 in file.day…