Skip to content

Commit

Permalink
weight recurring tasks higher
Browse files Browse the repository at this point in the history
  • Loading branch information
BrianHicks committed Nov 15, 2022
1 parent e05cc42 commit 8f0abc2
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Gardening.omnifocusjs/Resources/pick.js
Expand Up @@ -214,6 +214,10 @@
if (task.effectiveDueDate) {
weight += 100 - this.daysBetween(now, task.effectiveDueDate);
}
// weight recurring tasks higher
if (task.repetitionRule && task.effectiveDeferDate) {
weight += Math.max(14, this.daysBetween(now, task.effectiveDeferDate));
}
console.log(`${task.name}: ${weight}`);
weightedTasks.push([task, weight]);
}
Expand Down
8 changes: 8 additions & 0 deletions Gardening.omnifocusjs/Resources/pick.ts
Expand Up @@ -305,6 +305,14 @@
weight += 100 - this.daysBetween(now, task.effectiveDueDate);
}

// weight recurring tasks higher
if (task.repetitionRule && task.effectiveDeferDate) {
weight += Math.max(
14,
this.daysBetween(now, task.effectiveDeferDate)
);
}

console.log(`${task.name}: ${weight}`);
weightedTasks.push([task, weight]);
}
Expand Down

0 comments on commit 8f0abc2

Please sign in to comment.