I am trying to roll my daily note highlights into my Weekly Review note (credit to Bryan Jenks), and have it mostly working. The only issue I have is that the commands I am using starts weeks on a Monday (ISO week I believe), and I want my weeks started on a Sunday.
Things I have tried
I use the following DV query, and all works as expected except Sunday events show at the end of the previous week instead of the start of the week:
TABLE WITHOUT ID
file.link AS "Daily Note Source", highlight AS "Highlight"
FROM "001-Journal"
WHERE highlight != null
AND file.day.year = number(substring(string(this.file.name), 0, 4))
AND file.day.weekyear = number(substring(string(this.file.name), 6, 8))
SORT file.day
My understanding is that the file.day.weekyear starts weeks on Monday. Is there an equiv statement that starts weeks on Sunday?
To be able to change which day is the start of the week, you’ll need to make the underlying engine, in this case dataview, respect the locale in which you’re currently located where the start of the week is Sunday. This is easier said then done. See thread below from Stack Overflow regarding this matter:
Dataview is using Luxon (and a little bit of moment.js here and there), and it’s dependency states that the Luxon version needs to be above 3.2.0, so it’s supported per se. The problem is that I don’t think it currently respects the users locale when we’re running Obsidian, and that you don’t have any way of telling Dataview to change the locale for the date calls.
That is with the exception of when switching to dataviewjs where you could use options as described in the thread above. But then you also needs to translate your query into a dataviewjs query, which absolutely is doable but to many that’s a burden they don’t like.
In addition the thread above also talks about how the startOf-functions, even with correct locale options, still considers the Monday’s to be the first day of the week.
So, even though it’s not “correct” for your locale, I think it’s the easiest option to just learn to live with Monday as the first day of the week within Obsidian, since a lot of the functionality related to dates are also related to the ISO 8601 standard which also defines Monday as the first day of the week.
First of all, thank you for your detailed response, I sincerely appreciate it.
I think you are correct in saying that the best solution here is to change my behavior a bit and learn to live with a M-S week. I think the adjustments I need to make in Obsidian is to switch the start day of the week in the Calendar module and adjust some code in my weekly templates to use isoYear instead of year.