When I click on "Open this week" button I see an error "Unable to create file"
Root cause:
I dug through the source code. The problem that when the app calculates the beginning of the week we should use:
ISO week: moment.startOf("isoWeek")
Normal week: moment.startOf("week")
Test case:
> window.moment("2021-W47", "gggg-[W]WW", true).startOf("week").format("gggg-[W]WW");
< "2021-W46" // ERROR: expected "2021-W47"
> window.moment("2021-W47", "gggg-[W]WW", true).startOf("isoWeek").format("gggg-[W]WW");
< "2021-W47" // SUCCESS - this is what we should use for ISO weeks
> window.moment("2021-W47", "gggg-[W]ww", true).startOf("week").format("gggg-[W]ww");
< "2021-W47" // Non-ISO week works fine
The text was updated successfully, but these errors were encountered:
Yeah, this plugin admittedly could handle ISO dates better. Thanks for the report and the debugging!
A workaround for now is to change your locale using the Calendar plugin. In the Calendar plugin settings, there's a dropdown to change the locale to en-GB which will get respected by Periodic Notes too. Then can keep the format as gggg-[W]ww which will be the same as the ISO week numbers.
Btw using GGGG-[w]WW instead (or without the square brackets GGGG-WW) does work, but such format generates 2021-w52 (or without w) for the current week, which is also wrong.
Root cause:
I dug through the source code. The problem that when the app calculates the beginning of the week we should use:
Test case:
The text was updated successfully, but these errors were encountered: