Hello,
There are several options:
- Create a note and place your Headers, and place specific dataview request under each. It will allow to expand headers
- Use dataviewjs
For example
const findDated = (task)=>{
task.due_date="";
task.completed_date="";
const found_due = task.text.match(/📅.?([12]\d{3}-(0[1-9]|1[0-2])-(0[1-9]|[12]\d|3[01]))/);
const found_completion = task.text.match(/✅.?([12]\d{3}-(0[1-9]|1[0-2])-(0[1-9]|[12]\d|3[01]))/);
if(found_due) task.due_date = moment(found_due[1]);
if(found_completion) task.completed_date = moment(found_completion[1]);
return true;
}
const NextTasks = dv.pages("#project/active and #area/home and #next").file.tasks.where(t => findDated(t));
const OverdueNextTasks = NextTasks.filter(t=> moment(t.due_date).isBefore(moment(),"day")).filter(t=>!t.completed).sort(t => t.path, 'asc');
const TodayTasks = NextTasks.filter(t=> moment(t.due_date).isSame(moment(),"day")).filter(t=>!t.completed).sort(t => t.path, 'asc');
const Next2weeksTasks = NextTasks.filter(t=> moment(t.due_date).diff(moment(),"day")<14).filter(t=> moment(t.due_date).diff(moment(),"day")>=0).filter(t=>!t.completed).sort(t => t.path, 'asc');
const Coffee = '<center><img width="150px" src="file:///Users/viktoriyazaripova/Dropbox/_ZBrains/ZTypeableDTT/_Service/_Attachements/coffee.png"></center>';
dv.header(3,"Overdue Tasks");
if(OverdueNextTasks.length===0)
{
dv.paragraph(Coffee);
}
else
{
dv.taskList(OverdueNextTasks);
}
dv.header(3,"Today Tasks");
if(TodayTasks.length===0)
{
dv.paragraph(Coffee);
}
else
{
dv.taskList(TodayTasks);
}
dv.header(3,"Next 2 week Tasks");
if(Next2weeksTasks.length===0)
{
dv.paragraph(Coffee);
}
else
{
dv.taskList(Next2weeksTasks);
}
gives me the following:
or the following if all is implemented for today