@@ -38,6 +38,14 @@ class base {
3838 this . write ( this . formats . headline ( string ) ) ;
3939 }
4040
41+ /**
42+ * print a headline for warnings
43+ * @param string
44+ */
45+ warningHeadline ( string ) {
46+ if ( this . config . get ( 'noWarnings' ) ) return ;
47+ this . headline ( string ) ;
48+ }
4149 /**
4250 * print a warning
4351 * @param string
@@ -104,6 +112,9 @@ class base {
104112 let users = { } ;
105113 let projects = { } ;
106114 let times = [ ] ;
115+ let timesWarnings = [ ] ;
116+ let days = { } ;
117+ let daysMoment = { } ;
107118
108119 let spentFreeLabels = this . config . get ( 'freeLabels' ) ;
109120 if ( undefined === spentFreeLabels ) {
@@ -113,11 +124,24 @@ class base {
113124 [ 'issues' , 'mergeRequests' ] . forEach ( type => {
114125 this . report [ type ] . forEach ( issue => {
115126 issue . times . forEach ( time => {
127+ let dateGrp = time . date . format ( this . config . get ( 'dateFormatGroupReport' ) ) ;
116128 if ( ! users [ time . user ] ) users [ time . user ] = 0 ;
117129 if ( ! projects [ time . project_namespace ] ) projects [ time . project_namespace ] = 0 ;
130+ if ( ! days [ dateGrp ] ) {
131+ days [ dateGrp ] = { }
132+ daysMoment [ dateGrp ] = time . date ;
133+ } ;
134+ if ( ! days [ dateGrp ] [ time . project_namespace ] ) {
135+ days [ dateGrp ] [ time . project_namespace ] = { } ;
136+ }
137+ if ( ! days [ dateGrp ] [ time . project_namespace ] [ time . iid ] ) {
138+ days [ dateGrp ] [ time . project_namespace ] [ time . iid ] = 0 ;
139+ }
140+
118141
119142 users [ time . user ] += time . seconds ;
120143 projects [ time . project_namespace ] += time . seconds ;
144+ days [ dateGrp ] [ time . project_namespace ] [ time . iid ] += time . seconds ;
121145
122146 spent += time . seconds ;
123147 //if(time.parent.labels)
@@ -132,6 +156,7 @@ class base {
132156 }
133157 times . push ( time ) ;
134158 } ) ;
159+ issue . timesWarnings . forEach ( warning => timesWarnings . push ( warning ) ) ;
135160
136161 totalEstimate += parseInt ( issue . stats . time_estimate ) ;
137162 totalSpent += parseInt ( issue . stats . total_time_spent ) ;
@@ -152,6 +177,8 @@ class base {
152177 return a . date . isBefore ( b . date ) ? 1 : - 1 ;
153178 } ) ;
154179
180+ this . days = days ;
181+ this . daysMoment = daysMoment ;
155182 this . users = _ . mapObject ( users , user => this . config . toHumanReadable ( user , 'stats' ) ) ;
156183 this . projects = _ . mapObject ( projects , project => this . config . toHumanReadable ( project , 'stats' ) ) ;
157184 this . stats = {
@@ -164,6 +191,7 @@ class base {
164191 this . spent = spent ;
165192 this . spentFree = spentFree ;
166193 this . totalSpent = totalSpent ;
194+ this . timesWarnings = timesWarnings ;
167195 }
168196
169197 /**
0 commit comments