obsidian-dataview icon indicating copy to clipboard operation
obsidian-dataview copied to clipboard

there is not a default value for "created" of the object "task" when using func ".where(t => t.created > recentDate)" to filter recent tasks.

Open ccyousa opened this issue 2 years ago • 1 comments

What happened?

there used to be a default value for "task.created" (by the page.cday), but now there isn't such a default value and i don't know how to fix it. Or is there anyway to filter recent tasks such as within a week or a month?

DQL

const current = new Date(); const recent = new Date(); recent.setDate(recent.getDate() - 15);

const groups = dv.pages() .file .tasks .where(t => recent <= t.created && t.created < current) .sort(t => t.created, "desc");

dv.taskList(groups)

JS

No response

Dataview Version

0.5.41

Obsidian Version

0.15.9

OS

Windows

ccyousa avatar Aug 18 '22 08:08 ccyousa

You can use file.cday or file.mday directly before going down into the tasks array.

AB1908 avatar Aug 28 '22 14:08 AB1908