Query Tasks completed today with DataviewJS

Query Tasks completed today with DataviewJS

Hi Everyone,

I’d like to track how many tasks are completed in a day, or maybe during a given period.

Things I have tried

To start simply, I’ve tried to make a script that calls all of the completed tasks today.
Heres the following DataviewJS script i’ve implmented:

let q = dv.pages()

dv.taskList(q.file.tasks
	.sort(p => p.completion, 'desc')
	.filter(p => p.completion == dv.date('today'))
	, "")

This doesnt work, and just returns nothing.

I have done the equivalent in DQL, but im hoping for a DataviewJS solution, as i usually like to tap into its higher capabilities.

Any ideas or solutions?