obsidian-calendar-plugin
obsidian-calendar-plugin copied to clipboard
Wrong week number
Before Submitting: Double-check that you are running the latest version of the plugin. The bug might have already been fixed 😄
Describe the bug
The week number is not correct.
Expected behavior
That the calendar plugin will show that 2022-07-30 belongs to WEEK 30 ~~31~~ Link to google about day 30 Jully 2022
Screenshots
RIGHT SIDE IS DATAVIEW | LEFT THE CALENDAR PLUGIN
Environment (please specify)
macOS Obsidian v1 Minimal theme
The issue actually lies within the obsidian-calendar-ui. I created a pull request in this project to fix the issue.
Because the plugin seems somewhat abondened I "fixed" it on my local plugin installation, by replacing: weekNum: date.week()
with weekNum: date.isoWeek()
(line 2117) in the main.js file of the calendar plugin. After that the correct weeknumber is shown in the calendar.
Additionally. if you are using the periodic notes plugin with weekly notes you should set the "Format" value in the "Weekly Notes" section. If it isn't set, "Weekly notes" are created with the wrong weeknumber(non-ISO Weeknumber). It is even visible in the settingspage:
Unset value(default value):
Set value:
The week number in the calendar is correct for "Western traditional" numbering system, which is used in US. This plugin uses this counting system when the "Overwrite locale" of that plugin is set up to:
- en
- en-us
- few others are described in Week numbering system wiki
So if you want to use ISO 8601 week numbering system, you have to switch this setting to the country which uses that system. (in Europe mostly) For English, it will be 'en-gb'
Example with 'en-gb'
Example with 'en-us'