Last active
December 7, 2023 01:12
-
-
Save renatocaliari/85d44b9b62877b99dfa050c2d15caafe to your computer and use it in GitHub Desktop.
logseq query for overdue blocks
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{: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