Speedup the signoff report by short circuiting when the first task not on today is found
This commit is contained in:
parent
c6942468b2
commit
154793ccbe
2 changed files with 28 additions and 26 deletions
|
|
@ -1,6 +1,6 @@
|
|||
[package]
|
||||
name = "day-reporter"
|
||||
version = "1.4.0"
|
||||
version = "1.4.1"
|
||||
edition = "2021"
|
||||
|
||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||
|
|
|
|||
|
|
@ -12,9 +12,8 @@ to.setHours(23);
|
|||
to.setMinutes(59);
|
||||
to.setSeconds(59);
|
||||
|
||||
logbook.filter(task => {
|
||||
return task.completionDate() >= from && task.completionDate() < to;
|
||||
}).forEach(todo => {
|
||||
for (const todo of logbook) {
|
||||
if(todo.completionDate() >= from && todo.completionDate() < to) {
|
||||
var proj = todo.project();
|
||||
var tags = [];
|
||||
if (proj) {
|
||||
|
|
@ -37,6 +36,9 @@ logbook.filter(task => {
|
|||
area: area && { id: area.id(), title: area.name() },
|
||||
tags: [...tags, ...todo.tagNames().split(', ')].filter(t => t),
|
||||
});
|
||||
});
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return JSON.stringify(objs, undefined, 2);
|
||||
|
|
|
|||
Reference in a new issue