srg-kostyrko / obsidian-journal

MIT License
118 stars 7 forks source link

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

Closed Scoubines closed 1 month ago

Scoubines commented 1 month 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 1 month 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

Scoubines commented 1 month ago

Thank you much for your reply @srg-kostyrko!

So overall I understood that I'll have to wait for the V2 for that to be fixed (+ the smaller Nav display). Thank you for your awesome work meanwhile!

I've installed the BRAT plugin to stay informed whenever there will be a beta but there isn't one yet, right? Any insight when the V2 will be ready btw?

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

For that part I'm not sure I understood it right...? The YYYY/MM/YYYY-[W]ww format I'm using seems to be quite popular on youtube and works very well for me so far enabling me to have new nested folder created for better search after.

srg-kostyrko commented 1 month ago

So overall I understood that I'll have to wait for the V2 for that to be fixed

For now you can create note through plugin in wrong folder and after that manually move it to correct one. To be on safe side - reload obsidian after this (there is an issue that plugin internal cache is not updated on file move and it keeps using old path)

I've installed the BRAT plugin to stay informed whenever there will be a beta but there isn't one yet, right? Any insight when the V2 will be ready btw?

yes, there is no beta yet, I'm currently about midway through the list of all changes planned for v2. It will depend on how much time I'll have but I hope to release v2 till the end of year

The YYYY/MM/YYYY-[W]ww format I'm using seems to be quite popular on youtube and works very well for me so far enabling me to have new nested folder created for better search after.

this format is popular because in daily notes or periodic notes plugin this is the only way to get folder per year as you see it also works in Journals plugin why I usually advise not to use it - this format will be used to format dates related to journal (in variables like {start_date} or {end_date} for example) and for more streamlined use of variables it is better to define that format to be just meaningfull part and move construction of folder path to Folder field if you are not using variables much - you can leave it as is