hamo
November 22, 2022, 5:53am
1
I have listed the tasks listed in “Project Files” in dataviewjs below.
dataviewjs
dv.taskList(dv.pages('"Project Files"').file.tasks
.where(t => !t.completed)
.groupBy(t => t.section))
In this state, they are listed in order of filename, but is there a way to list them in the order in which the files were modified?
mnvwvnm
November 22, 2022, 11:17am
2
I’m not versed in JS and this is a “hard” task to solve (in DQL it’s a easy thing, because the group retains in rows all metadata in page object… but in JS it retains in rows only the metadata in tasks level).
But try this:
dv.taskList(dv.pages('"Project Files"').file.tasks
.where(t => !t.completed)
.groupBy(t => t.section)
.sort(k => dv.page(k.key.path).file.mtime, 'desc'))
DQL query
TASK
FROM "Project Files"
WHERE !completed
GROUP BY section
SORT rows.file.mtime DESC
3 Likes
hamo
November 23, 2022, 2:32am
3
hi, @mnvwvnm
That’s perfect!!! Thank you so much!!!
system
Closed
February 21, 2023, 2:32am
4
This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.