obsidian-calendar-plugin
obsidian-calendar-plugin copied to clipboard
Week number different in Linux version
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 Linux version of Calendar is a week ahead. The week beginning 30 May is numbered 23. But it is 22 on Windows and mobile versions.
Expected behavior
The week numbers would align with the calendar the same.
Environment (please specify)
Linux on Chrome OS
Obsidian Version (e.g. v0.10.6)
0.12.4
I can confirm that this also happens in macOS.
Obsidian version: 0.12.4 Plugin version: 1.5.10
Yeah… seems to be happening to me too. My current guess is that the week numbers in the Calendar plugin are not using the locale properly to change between ISO and en-us
.
OSX local settings
Fantastical current week number
Obsidian Week Plugin Settings
Obsidian Week Display
This is actually kinda confusing… because the current ISO week for June 29th is 26 according to https://www.epochconverter.com/weeknumbers, and fantastical agrees.
I wonder if it's moment.js, but here's what moment says about the week number: I have this dataviewjs snippet in my weekly note to pull daily notes related to it:
let p = function(b) {
switch(b) {
case "": return ""; break;
case " ": return ""; break;
case 0: return "❌❌❌"; break;
case 1: return "🔴⚪️⚪️"; break;
case 2: return "🟡🟡⚪️"; break;
case 3: return "🟢🟢🟢"; break;
}
}
let start = moment(dv.current().file.name, "gggg-[W]ww").add(7, "d");
let end = start.clone().add(6, 'd');
dv.header(2, `Dailies: ${start.format("MM-DD")} - ${end.format("MM-DD")}`)
dv.table(
["Daily", "Husband", "Father", "Work"], dv.pages('"journal/daily"')
.filter(d => moment(d.file.name).isBetween(start, end))
.map(d => [d.file.link, p(d.husband), p(d.father), p(d.work)])
)
and for W26 it returns:
(which appears to be right.)
dates and times are hard y'all!
Currently installed plugins:
calendar
dataview
media-extended
nldates-obsidian
obsidian-advanced-uri
obsidian-excalidraw-plugin
obsidian-git
obsidian-kanban
obsidian-kindle-plugin
obsidian-mind-map
obsidian-style-settings
obsidian-system-dark-mode
periodic-notes
review-obsidian
table-editor-obsidian
I am able to reproduce the issue. I will make a fix as soon as possible.
@liamcain awesome! Ping me if you need a dev-test.
(Side note, the Periodic Notes plugin has the same problem while selecting the week note… I believe the two are related.)
It seems also applicable for Android mobile app.
Google week number is different than obsidian calendar week number
For funsies, this occurs on a completely bare Obsidian Vault, where the only community plugin installed is Periodic Notes.
Just to confirm I have the same. Fairly new install of Obsidian (installed yesterday), Calendar was the first plugin I installed. Week numbers are off by one. macOS here. I have my system set to English for everything GUI but have Swedish locale (I type 50/50 English/Swedish). According to https://weeknumber.com/ it is currently w37. My macOS calendar agrees, but my Obsidian Calendar says w38.
This is still an issue on MacOS (11.4) with the latest version of Obsidian and the Calendar plugin. Any fix in the making?
FWIW it "fixed itself" for me when I, in Calendar settings (within Obsidian that is) set it to "en-gb" as opposed to just "en" (I already had it on "Monday" for day to start the week).
FWIW it "fixed itself" for me when I, in Calendar settings (within Obsidian that is) set it to "en-gb" as opposed to just "en" (I already had it on "Monday" for day to start the week).
Yep the "en-gb" hack worked for me too. Thanks
So yes… this works. I'm not proud of it, but I'm currently using en-gb
as well.
Hi. I just want to add another data point. I run Obsidian on Windows (en-us
). The week number is fine unless I set the week to begin on Monday. In that case, it is off by one. Switching to en-gb
sets the week correctly. I hope you can fix the bug, but I'm glad there's a workaround. Thanks for the great plugin.
Unfortunately, the en-gb
switch has not worked for me on my installation. Currently, the calendar shows the first week in 2022 as being the week of Dec. 26, 2021 - Jan. 1, 2022. The ISO standard would list this as the last week of 2021 rather than the first week of 2022, it seems.

FWIW it "fixed itself" for me when I, in Calendar settings (within Obsidian that is) set it to "en-gb" as opposed to just "en" (I already had it on "Monday" for day to start the week).
Thanks for that. On MacOS latest, switching to en-gb
worked for me. This carried through to iOS as well.
FYI, the en-gb
works, but there's one caveat with the Natural Language Dates Plugin. It parses dates in en-gb
format because this settings is system wide.
en-us
: typically does @MM/dd
(month/day)
en-gb
: parses dates as @dd/MM
Example side effect with the date format of YYYY-MM-DD ddd
:
en-gb
@10/1
: [[2022-01-10 Mon]]
@1/10
: [[2022-10-01 Sat]]
@2022/10/1
: [[2022-10-01 Sat]]
@1/10/22
: [[2022-10-01 Sat]]
en-us
@10/1
: [[2022-10-01 Sat]]
@1/10
: [[2022-01-10 Mon]]
@2022/10/1
: [[2022-10-01 Sat]]
@1/10/22
: [[2022-01-10 Mon]]
Note: you'll need to restart Obsidian for the setting to apply to Natural Language Date
Related #248 Related #247 Related #222 Related #206 Related #183 Related #128
Related liamcain/obsidian-periodic-notes#95 Related liamcain/obsidian-periodic-notes#55 Related liamcain/obsidian-periodic-notes#41 Related liamcain/obsidian-periodic-notes#17 Related liamcain/obsidian-periodic-notes#13
pt-br
on linux also with this issue: https://github.com/liamcain/obsidian-periodic-notes/issues/131
Hoping and rooting for a fix as this causes quite some friction for two such amazing plugins!
Update 2: ignore. I'm revising this.
I just noticed something else:
When using GGGG-[W]W
as suggested in the FAQ, the plugin tries to create a week number offset by 2 instead of 1:
- On
linux
,pt-br
, plugins updated on obsidianv1.1.9
-
GGGG-[W]W
- Weekly Notes format -
53
- Week shown onCalendar plugin
-
52
- Week shown onGoogle Calendar
-
51
- Week created by thePeriodic notes plugin
Periodic notes plugin:
Calendar plugin week:
Google week:
Update 1
😮 😆 Oddly (and gladly) the Calendar highlights the correct week for the open note despite showing the wrong week number!
I had this issue as well and changing locale to "en-gb" did not fix.
I ended up changing the Periodic Notes Weekly Notes Format from "YYYY-[Wk]-WW" to "YYYY-[Wk]-ww" and this worked. Periodic Notes should now name and parse files based on locale week of the year instead of ISO week of the year according to Moment.js format reference.