Open mkirkland4874 opened 7 months ago
Brilliant - thank you. And I had forgotten that I had written that up.
I also like the idea of integrating these numbers with the calendar, but I also think it would be nice if I could access this information from Templater as well, I would like to have some text generated in my weekly, monthly and yearly templates to say something like the following
This year I have completed 534 tasks and left 87 tasks unfinished.
This month I have completed 79 tasks and left 12 tasks unfinished.
This week I have completed 24 tasks and left 2 tasks unfinished.
Whilst I have a working prototype for this in my fork, I don't consider it releasable yet because of the poor usability of the QueryResult class. It would need to be improved before release.
For example, accessing all the tasks via TaskGroups is really inconvenient.
I would also want to make sure that any stored arrays of values were returned readonly - maybe.
⚠️ Please check that this feature request hasn't been suggested before.
🔖 Feature description
Add a query/search feature to the API to allow other plugins to query tasks based on the task query language.
This would allow plugins like Full Calendar to be able to query and display tasks on a read-only basis. A related discussion on the Full Calendar discussion thread:
https://github.com/davish/obsidian-full-calendar/discussions/376#discussioncomment-7711424
✔️ Solution
There is some discussion around a search feature in section 5.2 at https://github.com/obsidian-tasks-group/obsidian-tasks/discussions/1646#discussion-4836417 with similar code below.
Here is a link to that search function. Some form of the search feature would need to be added to the API.
https://github.com/claremacrae/obsidian-tasks/blob/c302c57ae4a5ad2f1aa2d071c3d8565f24229e12/src/main.ts#L76-L81
❓ Alternatives
No response
📝 Additional Context
No response