Show all notes for a given week

Things I have tried

I’ve searched through the forum for some help on this and found the below query which works fine for my monthly note but I’m now trying to get it to work on my weekly notes.

I’m trying to list all meetings in a given week but my current code seems to be wonky.

In the front matter of my weekly note I have the date for the first day of the week (for week 22 it has date: 2022-05-30)

This query

    LIST without id date
    FROM "meetings"
    WHERE file.day.week = this.file.day.week
    AND file.day.year = this.file.day.year
    SORT file.day asc

Returns the following meeting dates (Meeting names hidden)

    March 28, 2022
    March 30, 2022
    March 30, 2022
    March 30, 2022
    March 30, 2022
    March 30, 2022
    April 28, 2022
    April 28, 2022
    April 28, 2022
    April 29, 2022
    April 29, 2022
    April 29, 2022

What I’m trying to do

I would expect to see all meetings that occur between 2022-05-30 and 2022-06-05 (Mon-Sun)

Hi @stefwill,

I think you need to use file.day.weekyear (the week of the year), not file.day.week (the week of the month). This query worked for me:

```dataview
TABLE file.day, file.day.weekyear, this.file.day.weekyear
WHERE file.day.weekyear = this.file.day.weekyear
  AND file.day.year = this.file.day.year
SORT file.day asc
```
1 Like

Weekyear weeks start on Mondays if I understood the ISO date information correctly, and it sounds like the example start date in the question was a Sunday (the last day of the previous week, in weekyear thinking). Could you add one day to the date before comparing weekyears to counter that? Wait no, that is buggy if this.file.day is the Sunday that begins the week - any idea how to fix?

Thanks for that @Craig, it works like a charm.
Is there a list of all of the “Implicit Fields” options?
I know this list but it only shows file.blah not all the options that can come after, such as file.day.weekyear or file.day.week.
Cheers
Stef

1 Like

These date-related fields are documented on a different page of the documentation! These apply to anything that dataview believes is a date or date+time, including fields you write (explicit fields?) that are dates.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.