Skip to content

Commit

Permalink
#286: Change focus deadline for procrastination graph
Browse files Browse the repository at this point in the history
  • Loading branch information
kohler committed Sep 17, 2024
1 parent 6d4b427 commit bda0286
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions scripts/graph.js
Original file line number Diff line number Diff line change
Expand Up @@ -289,10 +289,18 @@ procrastination_seq.label = function (dl) {
};

function max_procrastination_seq(ri, dl) {
var seq = [], i, dlx = Math.max.apply(null, dl);
for (i in ri)
if (ri[i][0] > 0)
seq.push((ri[i][0] - dlx) / 86400);
const now = now_sec();
let dlx;
for (const d of dl) {
if (dlx == null
|| (d > now ? d < dlx || dlx < now : d > dlx))
dlx = d;
}
const seq = [];
for (const r of ri) {
if (r[0] > 0)
seq.push((r[0] - dlx) / 86400);
}
seq.ntotal = ri.length;
return seq;
}
Expand Down

0 comments on commit bda0286

Please sign in to comment.