Open linhtto opened 2 years ago
Same issue on IOS, but it works correctly in macOS and android, seems a bug in obsidian library window.moment
Same issue here, although I'm on macOS. I do have the Calendar plugin installed. Any fix for this yet?
A "solution" I found on the Calendar plugin github issues is to set your locale to "en-gb" (even if you are in the US). The calendar plugin was not showing the correct week numbers. Week 1 in 2022 should start January 3. As I understand it, week 1 is the first week in the calendar year that contains a Thursday (https://en.wikipedia.org/wiki/ISO_week_date). Not sure if the problem is Calendar or Momentjs (I'm suspicious its the latter), but things seemed to work as I expected once I changed the locale. I glanced at several years into the future and the week number seemed to correspond to my expectations (though I'm not an expert on such things). YMMV
Obsidian v0.15.9 macOS v12.5 Periodic Notes v 0.0.17 Calendar v 1.5.10
I seem to be having this issue as well. I've set periodic notes to use GGGG-[W]WW
for the format. It displays 2022-W33 as my syntax (which is correct as of me writing this). But if I create a new weekly note, the week is wrong.
{{title}} outputs: 2022-W32
{{date:[Week] ww}} outputs: Week 34
Not sure what's going on. My Calendar plugin is set to start the week on Sunday; and the locale is same as system. I'll try changing to "en-gb" and report back.
Obsidian v0.15.9 Ubuntu 22.04.1 Periodic Notes v 0.0.17
Same here, I can get it to make a note for one week before or after the correct one, lol.
The correct week number for me is 34. The format gggg-[W]ww shows up as W35 in the settings and makes a note titled 2022-W35. The format gggg-[W]WW shows up as W34 in the settings (correct) and makes a note titled 2022-W33, and every consecutive press of the shortcut results in an "Unable to create new file" message (doesn't happen for gggg-[W]ww).
Thanks for the suggestions so far, I'm not sure how locales work on Linux, I'll mess about with it.
This is exactly the same behavior I get on my MacOS. And changing the locale doesn't help at all.
What TZ are folk experiencing this bug in? I'm equivalent to UTC+12 currently and I see the wrong week get calculated.
(I ask because when I hit date behaviour bugs, I often find they are hard to reproduce for those based in "less futuristic" timezones.)
For me, steps to reproduce are:
date +%U
outputs 36
templates/Daily Note.md
contains:
day: {{date:YYYY-MM-DD}}
- Week: [{{date:GGGG-[W]WW}}]({{date:YYYY/[W]WW}}.md) of {{date:GGGG}}
templates/Weekly Note.md
contains:
week: {{date:GGGG-[W]WW}}
2022/09/07.md
with content:
day: 2022-09-07
- Week: [2022-W36](2022/W36.md) of 2022
2022/W37.md
with content:
week: 2022-W37
Using the date complication to move from day to week does this:
{{date:WW}}
) takes me to W36In the daily note, the current week is W36, but when I click the daily note to get to W36, W36 shows the date complication for last week.
^ UTC-04
The issue I'm seeing is that only creating a weekly note does this and not daily. This tells me the that logic to create a daily note is using the locale instead of ISO and daily note creation is using ISO. The preview in the settings also is using ISO.
From moment.js docs https://momentjs.com/docs/#/displaying/format/
That said this is not related to date settings on the computer itself.
UPDATE: Logic that switches WW to ww: https://github.com/liamcain/obsidian-periodic-notes/blob/64b38e24d787b77f3c11bd64af78ce84ab03e883/src/switcher/switcher.ts#L77-L79
https://github.com/liamcain/obsidian-periodic-notes/blob/main/src/utils.ts#L332
It looks like this isIsoFormat is incorrectly checking the format. The ternary logic is reversed.
https://github.com/liamcain/obsidian-periodic-notes/issues/133#issue-1341647352 looks like a duplicate?
No, it's not - I misread that!
There may be issues of Calendar + Periodic Notes plugin, but the issues described here are unrelated to it.
I agree that it's only an issue with the Weekly Note, and it seems entirely fixable because it's correct elsewhere (in the Setting Preview and also as stated above, in the Daily Note)
Setting the locale to en-gb
helped. In particular, install the Calendar plugin, set it to en-gb
in Calendar plugin settings, optionally set Sunday as start of the week in Calendar plugin settings, reboot Obsidian.
I choose "GGGG-[W]WW" as the name of the weekly note in the plugin setting. It shows me that today should be 2022-W27, which is correct.
However, if I choose to create a weekly note today it'll create "2022-W26" as the new weekly note, which is incorrect.
- This is an issue that can't be fixed manually each week. If I change this manually to "2022-W27", then next week, when I want to create a new weekly note, it won't, because of the filename conflict.
- In fact, this is a bug in and of itself: If the file is already created, it should open the file instead of displaying an error that a file cannot be created.
Furthermore, ISO week starts on a Monday, and my computer is set as such as well, but the note name changes on a Sunday instead.
I do not have the Calendar plugin installed.
Adding that this is
* with Obsidian 0.15.6 and 0.14.15 * on MacOS 12.4
Hello, this is still an issue.
I am on Windows 10. Obsidian 1.5.12. Periodic notes 0.0.17. Calendar not installed.
Right now, it is the 2024-06-03 and the ISO week number is 23.
In the second screenshot, you can see that the preview name is correct (W23
), but it then tries to create W22
when clicking on the Week button.
Error in console:
Settings:
I don't know the code base, but looks like PR #141 fixes the issue no?
I do not have the Calendar plugin installed.
Adding that this is