This week's meetings only from the current year - dataviewJS

What I’m trying to do

I am trying to show all notes with a certain tag (meeting) in my weekly review note. The following code does this but it shows meetings from both the current year and previous years. I would like it to show just the current year.


date: 2023-08-02
date modified: 2023-08-03
  - weekly

Dataview code:

let currentWeekNumber = dv.current().date?.weekNumber;
	.where(n => == currentWeekNumber)
	.sort(n =>

Here is the output:

Things I have tried

I used advice from

and here:

I found this but I’m in over my head with Dataview JS and not sure what to do next:

Thank you for any help you can provide or if you have a simpler way to do this, pleas elet me know.


My friend ChatGPT says:
The issue in the code is that it’s filtering by the current week number, but not taking the year into account. Week numbers restart each year, so without considering the year, you may get results from the same week number but from different years.
Here’s a corrected version of the code that filters by both the current week number and the current year:

let currentDate = dv.current().date;
let currentWeekNumber = currentDate?.weekNumber;
let currentYear = currentDate?.year;
	.where(n => == currentWeekNumber && == currentYear)
	.sort(n =>

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