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 158
158
159
159
function getReport ( ) {
160
160
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
+ }
161
166
var table = new Tabulator ( "#report" , {
162
167
ajaxURL :baseUrl ,
163
168
layout :"fitColumns" ,
179
184
var m = Math . floor ( ( duration / 60 ) % 60 ) ;
180
185
var h = Math . floor ( ( duration / ( 60 * 60 ) ) ) ;
181
186
182
- return h + ':' + m + ':' + s ;
187
+ return pad ( h , 2 ) + ':' + pad ( m , 2 ) + ':' + pad ( s , 2 ) ;
183
188
184
189
} , bottomCalc :"sum" , bottomCalcParams :{
185
190
precision :1 ,
192
197
var m = Math . floor ( ( duration / 60 ) % 60 ) ;
193
198
var h = Math . floor ( ( duration / ( 60 * 60 ) ) ) ;
194
199
195
- return h + ':' + m + ':' + s ;
200
+ return pad ( h , 2 ) + ':' + pad ( m , 2 ) + ':' + pad ( s , 2 ) ;
196
201
197
202
} } , //column will be allocated 1/5 of the remaining space
198
203
] ,
Original file line number Diff line number Diff line change 173
173
174
174
function getReport ( ) {
175
175
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
+ }
176
181
var table = new Tabulator ( "#report" , {
177
182
ajaxURL :baseUrl ,
178
183
layout :"fitColumns" ,
193
198
var m = Math . floor ( ( duration / 60 ) % 60 ) ;
194
199
var h = Math . floor ( ( duration / ( 60 * 60 ) ) ) ;
195
200
196
- return h + ':' + m + ':' + s ;
201
+ return pad ( h , 2 ) + ':' + pad ( m , 2 ) + ':' + pad ( s , 2 ) ;
197
202
198
203
} , } , //column will be allocated 1/5 of the remaining space
199
204
] ,
322
327
323
328
324
329
} ) ;
325
- } ( ) ) ;
330
+ } ( ) ) ;
You can’t perform that action at this time.
0 commit comments