File tree Expand file tree Collapse file tree 2 files changed +9
-4
lines changed
Expand file tree Collapse file tree 2 files changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -12,6 +12,11 @@ const removeRegex = /Removed time spent/i;
1212 * base model for models that have times
1313 */
1414class hasTimes extends Base {
15+ constructor ( config ) {
16+ super ( config ) ;
17+ this . times = [ ] ;
18+ }
19+
1520 /**
1621 * create time
1722 * @param time
Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments