The code below used to work previously but it no longer works. I want to see upcomming tasks between 8th day to 14th day.
{:title [:h1 "📅️ FUTURE"]
:query [:find (pull ?b [*])
:in $ ?start ?next
:where
[?b :block/marker ?marker]
[(contains? #{"LATER" "TODO"} ?marker)]
(or-join [?start ?next ?b]
;; Scenario 1: Task has a scheduled date today or in the future but less than 'next'
(and
[?b :block/scheduled ?scheduled]
[(>= ?scheduled ?start)] ; Scheduled today or in future
[(< ?scheduled ?next)]) ; But less than 'next'
;; Scenario 2: Task has a deadline today or in the future but less than 'next'
;; exclude scheduled task as they might be before ?start
(and
[?b :block/deadline ?deadline]
(not [?b :block/scheduled _])
[(>= ?deadline ?start)] ; Deadline today or in future
[(< ?deadline ?next)]) ; But less than 'next'
)]
:inputs [:+8d :+14d]
:result-transform (fn [result] (sort-by (fn [r] (get-in r [:block/scheduled])) result)) ; sort the result by the scheduled date
:collapsed? false}