File tree Expand file tree Collapse file tree 2 files changed +14
-4
lines changed Expand file tree Collapse file tree 2 files changed +14
-4
lines changed Original file line number Diff line number Diff line change 158158
159159 function getReport ( ) {
160160 var baseUrl = OC . generateUrl ( '/apps/timetracker/ajax/report?name=&from=' + start . unix ( ) + '&to=' + end . unix ( ) + '&group1=' + group1 + '&group2=' + group2 + '&timegroup=' + group3 + '&filterProjectId=' + filterProjectId + '&filterClientId=' + filterClientId ) ;
161+ function pad ( n , width , z ) {
162+ z = z || '0' ;
163+ n = n + '' ;
164+ return n . length >= width ? n : new Array ( width - n . length + 1 ) . join ( z ) + n ;
165+ }
161166 var table = new Tabulator ( "#report" , {
162167 ajaxURL :baseUrl ,
163168 layout :"fitColumns" ,
179184 var m = Math . floor ( ( duration / 60 ) % 60 ) ;
180185 var h = Math . floor ( ( duration / ( 60 * 60 ) ) ) ;
181186
182- return h + ':' + m + ':' + s ;
187+ return pad ( h , 2 ) + ':' + pad ( m , 2 ) + ':' + pad ( s , 2 ) ;
183188
184189 } , bottomCalc :"sum" , bottomCalcParams :{
185190 precision :1 ,
192197 var m = Math . floor ( ( duration / 60 ) % 60 ) ;
193198 var h = Math . floor ( ( duration / ( 60 * 60 ) ) ) ;
194199
195- return h + ':' + m + ':' + s ;
200+ return pad ( h , 2 ) + ':' + pad ( m , 2 ) + ':' + pad ( s , 2 ) ;
196201
197202 } } , //column will be allocated 1/5 of the remaining space
198203 ] ,
Original file line number Diff line number Diff line change 173173
174174 function getReport ( ) {
175175 var baseUrl = OC . generateUrl ( '/apps/timetracker/ajax/report?name=&from=' + start . unix ( ) + '&to=' + end . unix ( ) + '&group1=' + group1 + '&group2=' + group2 + '&timegroup=' + group3 + '&filterProjectId=' + filterProjectId + '&filterClientId=' + filterClientId ) ;
176+ function pad ( n , width , z ) {
177+ z = z || '0' ;
178+ n = n + '' ;
179+ return n . length >= width ? n : new Array ( width - n . length + 1 ) . join ( z ) + n ;
180+ }
176181 var table = new Tabulator ( "#report" , {
177182 ajaxURL :baseUrl ,
178183 layout :"fitColumns" ,
193198 var m = Math . floor ( ( duration / 60 ) % 60 ) ;
194199 var h = Math . floor ( ( duration / ( 60 * 60 ) ) ) ;
195200
196- return h + ':' + m + ':' + s ;
201+ return pad ( h , 2 ) + ':' + pad ( m , 2 ) + ':' + pad ( s , 2 ) ;
197202
198203 } , } , //column will be allocated 1/5 of the remaining space
199204 ] ,
322327
323328
324329 } ) ;
325- } ( ) ) ;
330+ } ( ) ) ;
You can’t perform that action at this time.
0 commit comments