Render week dates with the Obsidian Calendar plugin template
The Obsidian Calendar plugin has a daily and weekly templates feature. While Obsidian itself has a Templates core plugin, Calendar's templates have a more powerful dates functionality.
In the weekly template, we can use eg. {{monday:YYYY-MM-DD}}
to render the date of current week's Monday in the note, eg. 2021-10-04
.
If we have daily notes with that structure, we can create a link to this week's Monday's note: [[{{monday:YYYY-MM-DD}}]]
.
Similarly, we can use it with the transclusion/embed syntax, eg. if we want to view the whole week's daily notes from the week note: ![[{{monday:YYYY-MM-DD}}]]
Weekly template example:
Week {{date:W}}, {{date:YYYY}}
Quarter:
[[{{date:YYYY-[Q]Q}}]]
Days:
[[{{monday:YYYY-MM-DD}}]], [[{{tuesday:YYYY-MM-DD}}]], [[{{wednesday:YYYY-MM-DD}}]], [[{{thursday:YYYY-MM-DD}}]], [[{{friday:YYYY-MM-DD}}]], [[{{saturday:YYYY-MM-DD}}]], [[{{sunday:YYYY-MM-DD}}]]
It renders the following:
# Week 40, 2021
Quarter:
[[2021-Q4]]
Days:
[[2021-10-04]], [[2021-10-05]] (etc)
Neat!
noteThis only works for notes generated through the Calendar plugin (either by clicking the week number in the sidebar UI or the "Open Weekly" command), not via the Templates plugin’s "Insert template" command.
In: Obsidian MOC