Hello, comrads!
I have some problem with dataviewjs (probably because I’m noob in JS)
Start position
Multiple notes with the next yaml structure
---
document_type: text
document_kind: text
reg_number: text
reg_date: 2023-04-27
synopsys: text
link: url
state: text
todo: text
todo_date: 2023-05-17 23:59
actual_todo_date: 2023-04-01
task: false // bolean
---
I’m creating aggregated table with all notes grouped by “this week”, “next week”, “later” and show only uncompleted.
Next week - Dates between EOW and EOW+7 days
Later - Dates after EOW+7 days
```dataviewjs
let pages = dv.pages('"folder_path"')
dv.header(1, "This week")
dv.table(["Task", "ToDo", "Todo Date", "State", "Document kind", "Registration date", "Synopsys", "Link", "Completed"],
pages.where(p => p.todo_date <= dv.date("eow")),
pages.map(p=> [
dv.func.link(p.file.path, p.file.name.replace('.', '/')),
p.todo,
p.todo_date,
p.state,
p.document_kind,
p.reg_date,
p.synopsys,
p.link,
p.task
],
))
But when I’m adding line pages.where(p.todo_date <= dv.date("eow"))
it shows nothing.
Without - the whole notes list.
Question
How should i write correct date comparison in dataviewjs?
dataview date(todo_date) <= date(eow)
works well