Skip to content

Instantly share code, notes, and snippets.

@renatocaliari
Last active December 7, 2023 01:12
Show Gist options
  • Save renatocaliari/85d44b9b62877b99dfa050c2d15caafe to your computer and use it in GitHub Desktop.
Save renatocaliari/85d44b9b62877b99dfa050c2d15caafe to your computer and use it in GitHub Desktop.
logseq query for overdue blocks
{:title [:h3 "🔥 Overdue"]
:query [:find (pull ?block [*])
:in $ ?start ?next
:where
(or-join [?block, ?d]
[?block :block/scheduled ?d]
[?block :block/deadline ?d]
(and
[?block :block/ref-pages ?rp]
[?rp :block/journal-day ?d]
)
)
(or-join [?block]
(and
[?block :block/marker ?marker]
[(contains? #{"NOW" "TODO" "LATER" "DOING"} ?marker)]
)
(and
(not [?block :block/marker _])
(or
[?block :block/scheduled ?d]
[?block :block/deadline ?d]
)
)
)
[(> ?d ?start)]
[(< ?d ?next)]]
:result-transform (fn [result]
(sort-by (fn [h]
(or (get h :block/scheduled) (get h :block/deadline))) result))
:inputs [:90d-before :0d-before]
:collapsed? false},
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment