obsidian-periodic-notes
obsidian-periodic-notes copied to clipboard
Weekly Notes confusing week number
Its Sat Feb 19. When I create a weekly note:
- The note file name is W06
- The Calendar highlights it on last week which is W07
- This week in the calendar is actually W08
This is my note name:
YYYY/[Weekly]/gggg-[W]WW
From what I can see periodic notes plugin gets confused only when calendar plugin is also installed (or enabled). Was noticing this problem as well. Everything went away after removal of calendar plugin.
Maybe fiddle with locales in the calendar plugin to setup first day of week.
I tried Locale default - Sunday, Sunday, and Monday but got the same results.
@mchwalisz @liamcain any ideas?
I removed the calendar plugin and it started to work as expected. I, however, understand this is not really solution you are looking for.
Maybe one should also raise awareness in the calendar plugin. One needs to debug where the behavior change is coming from. I don't have time and expertise to look into it.
It seems like the the en-us
locale is not using ISO week numbers. It works for me when I override the locale to en-ie
for Ireland.
Quick unrelated question: What do I need to do to link the previous and next weekly note in my template? There's nothing in the docs about that. Thanks!
@stefandesu that seemed to help!
I used this btw:
[[<%tp.date.now("gggg-[W]WW", -9)%>]] <== This Week ==> [[<%tp.date.now("gggg-[W]WW", 2)%>]]
I rewrite your code to work even when creating a weekly note for a future or past week:
[[<% tp.date.weekday("gggg-[W]WW", -7, tp.file.title, "gggg-[W]WW") %>]] <== This Week ==> [[<% tp.date.weekday("gggg-[W]WW", 7, tp.file.title, "gggg-[W]WW") %>]]
Requires that the note is named accordingly of course, e.g. 2022-W15
.
This issue has been discussed in several issues in obsidian-calendar, ie. in liamcain/obsidian-calendar-plugin#222
Thanks for the Templater template, @stefandesu. That's really helpful, it should be included in the official documentation.
Related liamcain/obsidian-calendar-plugin#248 Related liamcain/obsidian-calendar-plugin#247 Related liamcain/obsidian-calendar-plugin#222 Related liamcain/obsidian-calendar-plugin#206 Related liamcain/obsidian-calendar-plugin#183 Related liamcain/obsidian-calendar-plugin#128
Related #95 Related #55 Related #41 Related #17 Related #13