-
-
Notifications
You must be signed in to change notification settings - Fork 134
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Week opens in wrong year #333
Comments
I just encountered the same bug. It has been some time since I used weekly notes with calendar, but a year ago they worked as designed. Calender now shows and opens Weekly Notes form a year ago. It works fine when creating new weekly notes. I tried switching locale, deactivating periodic notes and daily notes. Weekly Note format: yyyy/[KW]ww/[KW]ww Example: Journal/2023/KW43/KW43.md |
Same for me... it finds past weeks even in a subfolder |
The issue seems to be in Here's a workaround for this: in if (granularity === 'week') {
const filePathParts = file.path.split('/');
const year = filePathParts[1];
const basename = filePathParts[filePathParts.length - 1];
const dateString = `${year}/${basename}`;
const formatString = `YYYY/${getSettings[granularity]()
.format.split('/')
.pop()}[.md]`;
return window.moment(dateString, formatString, true);
} restarting obsidian after this change should fix the problem. (you might have to tweak the code a bit depending on your format for weekly note. mine is |
@rajrajhans Thanks for the tip... I've adapted it to my particular folder setup. Although I've found that the problem seems to be associated with momentjs not parsing correctly the default format string
Changing it in Periodic Notes settings to |
Thanks @Inmovilizame. This did the trick. |
Describe the bug
Clicking on a week opens that week, but then a year earlier.
Steps to reproduce
Expected behavior
Expected to open the "2023-W40" note.
Environment (please specify)
This bug was introduced recently.
OS
macOS
Obsidian Version (e.g. v0.10.6)
v1.4.12
The text was updated successfully, but these errors were encountered: