srg-kostyrko / obsidian-journal

MIT License
102 stars 7 forks source link

1st week on a new year considered as 1st week of the same year #68

Open Scoubines opened 4 days ago

Scoubines commented 4 days ago

Hi!

So when playing around to prepare next year notes, I realized that when I am on the week 52 and click on next week (from the calendar-nav or directly on W1 in the calendar) Journal creates a new weekly note in a 01 folder in the same year (2024) instead of creating a 2025 folder and 01 folder for January. I'm not an expert but I think it comes from ISO calendar issue/the fact that there are always some remaining days of the same year when week 1 starts making Obsedian think we are still January 2024...Do my explanations make sense? Of course this issue will arise in all other years with the same paterns. The following weeks of next year’s work perfectly fine otherwise.

And strangely enough, even when I manually create a note 2025-W01 in a 2025 folder and 01 folder to "force it", and then try to navigate from week 2 to week 1 with nav or the calendar week button it jumps the note 2025 to go directly on a new 2024-W01 note.

I have to precise that my weekly note format is the following: YYYY/MM/YYYY-[W]ww so that it created new folders on demand.

Thank you again!

srg-kostyrko commented 4 days ago

that's a good catch by default when building name for new note plugin uses {{date}} that corresponds to first day of period (week in this case) so that is why it can grab previous year day for first week of a year and changing it to {{end_date}} while working this year - will not work other year where last week contains days from next one I'll probably will add additional variable for weeks that knows how to select start or end of week to pin it to correct year - most likely this will be part of v2 release

And strangely enough, even when I manually create a note 2025-W01 in a 2025 folder and 01 folder to "force it", and then try to navigate from week 2 to week 1 with nav or the calendar week button it jumps the note 2025 to go directly on a new 2024-W01 note.

Plugin is not using path to note as connection to journal, for this plugin adds couple properties to note frontmatter You can use Connect note command to insert correct properties into note and tie it to journal

I have to precise that my weekly note format is the following: YYYY/MM/YYYY-[W]ww so that it created new folders on demand.

I generally recommend instead of changing date format to include slashes - use folder setting that supports variables for your setting it would be folder -{{date:YYYY}}/{{date:MM}} date format - YYYY-[W]ww