Hello, Is this the correct feature request for a task that I’ve scheduled for 3 days from today not showing up as “NEXT” in my currently daily journal? NEXT query does not read scheduled and due dates · Issue #3720 · logseq/logseq · GitHub
Or am I not understanding it correctly?
Thank you for the amazing application.
Yeah. It’s indeed because the default NEXT query is a bit of a weird one.
I will see about writing a better version
1 Like
New and improved. I’ll put it over on GitHub as well.
{:title "📅 NEXT"
:query [:find (pull ?h [*]) ;get full block results
:in $ ?start ?next ;variables made from the values in :inputs to use in the query.
:where
[?h :block/marker ?marker] ;tasks are identified by having a marker like TODO
[(contains? #{"NOW" "LATER" "TODO"} ?marker)] ;specify which marker to include.
(or
[?h :block/page ?p] ;either the task is on a (journal) page
[?h :block/refs ?p] ;or references a (journal) page
)
;This will always be true as all blocks are on some page and tasks always reference a page, namely the default marker page i.e. TODO etc.
(or
[?p :block/journal-day ?d] ;the page is a journal page with date ?d
[?h :block/scheduled ?d] ;or the task is scheduled for date ?d
[?h :block/deadline ?d] ;or the task has a deadline for date ?d
)
[(> ?d ?start)] ;the date is bigger than ?start i.e. today
[(< ?d ?next)]] ;the date is smaller than ?next i.e. 7 days after today.
:inputs [:today :+7d] ;dynamic input to define start and next. In this case today and +7 days from today.
:group-by-page? false ;don't group the blocks by page (change to true to group)
:breadcrumb-show? true ;do show the parent block hierarchy of the block (change to false to hide it)
:collapsed? false} ;don't collapse the query to title only. Change to true to collapse the query.
1 Like