Skip to content

Query to show (not done) tasks only if it is in todays daily note? #1840

Answered by Deadcows
Deadcows asked this question in Q&A
Discussion options

You must be logged in to vote

That was quite a trip :) With a help of the google-fo I was able to write the following code, and it is seemingly do what I needed

var today = dv.date('today');
var noteDay = dv.current().file.day;
var noteToday = noteDay.toISODate();
var noteTomorrow = noteDay.plus({ days: 1 }).toISODate();

var freshNote = today.startOf("day") <= noteDay.startOf("day");

var query = `path includes Tasks.md\n`;
if (freshNote) query += `(not done) OR `;
query += 
`(done `+noteToday+`)
(no scheduled date) OR (scheduled before ` +noteTomorrow+ `)

sort by priority
sort by due
sort by done reverse
hide backlink
hide task count
`;

dv.paragraph('```tasks\n' + query + '\n```');

Replies: 4 comments 2 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by Deadcows
Comment options

You must be logged in to vote
2 replies
@claremacrae
Comment options

@Deadcows
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
scope: filters Additions and modifications to the search filters
2 participants