…I see the following in the console when I invoke the command "Open weekly note":
Failed to create file: 'Calendar/2024/W43.md' Error: File already exists.
at t.<anonymous> (app.js:1:732669)
at app.js:1:237228
at Object.next (app.js:1:237333)
at a (app.js:1:236051)
Now when I invoke the command, I see a notice bubble with text like:
Mon Oct 28 2024 20:19:48 GMT+0100
Sun Oct 27 2024 00:00:00 GMT+0200
Mon Oct 28 2024 00:00:00 GMT+0100
In short:
.startOf("week") gives a date 1 day prior to .startOf("isoWeek").
This behaviour changed at some point; it is not the same as recently (perhaps Obsidian prior to 1.7.0? I do not recall my update history exactly). In my experience, the periodic-notes behaviour has always been to treat Monday as the start of a new week, which aligns with ISO 8601.
I can imagine at least two possible reasons for (2):
The behaviour was due to a code change in periodic-notes, Obsidian, Electron, or something further upstream. I don't know how to determine where this may have changed, or when.
There was no code change, but some code has a bug related to the end of daylight savings time (note the GMT+0100 and GMT+0200 mixed in the debug output).
I managed to hack a workaround by modifying the abovementioned .js file to include:
With:
…I see the following in the console when I invoke the command "Open weekly note":
I should note at this point that I am not a JavaScript developer. But this apparently occurs because of this code: https://github.com/liamcain/obsidian-periodic-notes/blob/5b96e4f14130b0c024edb5ddb7871d01d61d9522/src/commands.ts#L41-L47 https://github.com/liamcain/obsidian-periodic-notes/blob/5b96e4f14130b0c024edb5ddb7871d01d61d9522/src/commands.ts#L71-L77 I don't see this file in my Obsidian directory. Instead at .obsidian/plugins/periodic-notes/main.js there is a file including:
I add some debug code:
Now when I invoke the command, I see a notice bubble with text like:
In short:
.startOf("week")
gives a date 1 day prior to.startOf("isoWeek")
.I can imagine at least two possible reasons for (2):
I managed to hack a workaround by modifying the abovementioned .js file to include:
and
With this, the command works as expected.