Hi amazing Obsidian community.
I’m trying to filter the task lists in my daily journals from the last 7 days. However, Whatever command I’m trying in DataviewJS, I can’t get it working.
My daily journal filenames are formatted like ‘YYYY-MM-DD-ddd’ (e.g. ‘2022-03-8-Tue’). In each file, I have some tasks and I only want to filter tasks that do not contain ‘#tag1’ and ‘#tag2’.
Here is my dataviewjs code snippet. I need help in Line 3 of the code snippet (where( p => ....)
- Is
dv.date(p.file.name) correct in converting ‘2022-03-08-Tue’ to a date object?
- How can I get today’s date (should replace
TODAY in the code snippet below) in DataviewJS?
```dataviewjs
dv.taskList(
dv.pages('"01 Journal"')
.where(p => (dv.date(p.file.name) >= (TODAY - dv.duration('7 days'))))
.sort(p => p.file.name, 'desc')
.file.tasks
.where(t => !t.text.includes("#tag1"))
.where(t => !t.text.includes("#tag2"))
)
```
Thanks in advance