Skip to content

Instantly share code, notes, and snippets.

@kylestratis
kylestratis / Tasks by Date - for Obsidian and Dataview.js
Last active August 23, 2024 23:11 — forked from TfTHacker/Tasks by Date - for Obsidian and Dataview.js
A fork of TfTHacker's daily tasks query that, among other things, bases dates for overdue/due/upcoming tasks on the current page's title
```dataviewjs
// find dates based on format [[YYYY-MM-DD]]
const findDated = (task)=>{
if( !task.completed && !task.path.startsWith('Bins/Roam Import')) { // ignores Roam imports
task.link = " " + "[[" + task.path + "|*]]";
task.date="";
const found = task.text.match(/\[\[([12]\d{3}-(0[1-9]|1[0-2])-(0[1-9]|[12]\d|3[01]))\]\]/);
if(found) task.date = moment(found[1]);
return true;
}