Is there a way through dataview to show me only the tasks specified for a specific date and show them inside a progress bar?
I want dataview to show me task 1 and task 2 from “Project A” and task 4 from “Project B”, becuase they have the same date, which is today and show them in a progress bar.
The example (image) doesn’t have part of the solution?
That progress bar I did it manual, I want it to be automatically from the tasks that include a specific date.
So. Let’s try this:
In this example I use
due:: instead of
date:: (to avoid confusing with the function
Example md files
# Project A
- [x] task 1 [due:: 2022-09-09]
- [ ] task 2 [due:: 2022-09-09]
- [ ] task 3 [due:: 2022-09-10]
# Project B
- [x] task 4 [due:: 2022-09-09]
- [ ] task 5 [due:: 2022-09-12]
- [ ] task 6 [due:: 2022-09-15]
- Daily note with the title in format
const myDate = dv.current().file.day.toFormat("yyyy-MM-dd")
const pages = dv.pages('"MyFolderPath"').file.tasks.where(t => t.due?.toFormat("yyyy-MM-dd") === myDate)
const total = pages.length
const done = pages.where(t => t.completed).length
const value = (done) / (total || 0) * 100
dv.paragraph("<progress value='" + value + "' max='100'></progress>" + "<br>" + value.toFixed(0) + "% completed")
WHERE due = this.file.day
- You need to change “MyFolderPath”: folder path, a tag or …
- Because I don’t know how to work properly with dates in JS I use the format conversion to facilitate the dates comparison.
- The result:
It’s worked, you saved my day. Thanks a lot.
This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.