obsidian-calendar-plugin icon indicating copy to clipboard operation
obsidian-calendar-plugin copied to clipboard

Wrong week number

Open dxcore35 opened this issue 2 years ago • 2 comments

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

Screen Shot 2022-10-15 at 17 43 38

RIGHT SIDE IS DATAVIEW | LEFT THE CALENDAR PLUGIN

Environment (please specify)

macOS Obsidian v1 Minimal theme

dxcore35 avatar Oct 15 '22 14:10 dxcore35

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): image

Set value: image

muejam09 avatar Oct 26 '22 08:10 muejam09

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:

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' image image

Example with 'en-us' image image

maledorak avatar Feb 28 '23 07:02 maledorak