Logseq done time plugin
This simple Logseq plugin adds a property to task blocks when they are marked as done. This can be used for creating reports for tasks done yesterday, last week etc.
Look for "done time" in the Logseq Marketplace.
- Adds a
done-ms
property to tasks when they are marked as DONE. - This property is in milliseconds to support sorting and precise filtering in queries.
- The property is removed if a task's state changes from DONE to anything else.
{
:title [:b "DONE today"]
:query [:find (pull ?b [*])
:in $ ?start
:where
[?b :block/marker ?marker]
[(contains? #{"DONE"} ?marker)]
[?b :block/properties ?props]
[(get ?props :done-ms) ?done-ms]
[(>= ?done-ms ?start)]
]
:inputs [:start-of-today-ms]
}
{
:title [:b "DONE yesterday"]
:query [:find (pull ?b [*])
:in $ ?start ?end
:where
[?b :block/marker ?marker]
[(= "DONE" ?marker)]
[?b :block/properties ?props]
[(get ?props :done-ms) ?done-ms]
[(>= ?done-ms ?start)]
[(< ?done-ms ?end)]
]
:inputs [:-1d-start :start-of-today-ms]
}
The done-ms
property isn't particularly nice to look at so I recommend hiding it using the :block-hidden-properties
option in your config.edn
.
For example:
::block-hidden-properties #{:done-ms}
Alternatively, the Awesome Props plugin can be used to hide the property from view mode while still allowing it to be seen when editing.
This plugin in heavily inspired by the Task completion plugin by DimitryDushkin, and the DONE task property plugin by YU000jp.
yarn build
- Commit the changes.
git push
- Make release in GitHub.