Skip to content

Commit 85bfad4

Browse files
committed
Fix error with new show without times option
1 parent 941c78a commit 85bfad4

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

models/hasTimes.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,11 @@ const removeRegex = /Removed time spent/i;
1212
* base model for models that have times
1313
*/
1414
class hasTimes extends Base {
15+
constructor(config) {
16+
super(config);
17+
this.times = [];
18+
}
19+
1520
/**
1621
* create time
1722
* @param time

models/report.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,8 @@ class report extends Base {
8585
* @param issues
8686
* @returns {Array}
8787
*/
88-
static filter(issues) {
89-
return issues.filter(issue => (this.config.get('showWithoutTimes') || issue.times && issue.times.length > 0));
88+
filter(issues) {
89+
return issues.filter(issue => this.config.get('showWithoutTimes') || (issue.times && issue.times.length > 0));
9090
}
9191

9292
/**
@@ -101,7 +101,7 @@ class report extends Base {
101101

102102
let promise = this.parallel(this[input], (item, done) => {
103103
// filter out things that are too old
104-
if (moment(item.updated_at).isBefore(this.config.get('from'))) {
104+
if (!this.config.get('showWithoutTimes') && moment(item.updated_at).isBefore(this.config.get('from'))) {
105105
if (advance) advance();
106106
return done();
107107
}
@@ -119,7 +119,7 @@ class report extends Base {
119119
});
120120
});
121121

122-
promise.then(() => this[input] = report.filter(collect));
122+
promise.then(() => this[input] = this.filter(collect));
123123
return promise;
124124
}
125125

0 commit comments

Comments
 (0)