Skip to content

Commit 6a2a7b4

Browse files
authored
Merge pull request mtierltd#32 from q4z1/master
reports - sum added
2 parents 5d2843b + 6aa3a45 commit 6a2a7b4

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed

js/reports.js

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,20 @@
181181

182182
return h + ':' + m + ':' + s;
183183

184-
},}, //column will be allocated 1/5 of the remaining space
184+
},bottomCalc:"sum", bottomCalcParams:{
185+
precision:1,
186+
},bottomCalcFormatter:function(cell, formatterParams, onRendered){
187+
//cell - the cell component
188+
//formatterParams - parameters set for the column
189+
//onRendered - function to call when the formatter has been rendered
190+
var duration = cell.getValue();
191+
var s = Math.floor( (duration) % 60 );
192+
var m = Math.floor( (duration/60) % 60 );
193+
var h = Math.floor( (duration/(60*60)));
194+
195+
return h + ':' + m + ':' + s;
196+
197+
}}, //column will be allocated 1/5 of the remaining space
185198
],
186199
ajaxResponse:function(url, params, response){
187200

@@ -201,4 +214,4 @@
201214

202215

203216
} );
204-
}());
217+
}());

0 commit comments

Comments
 (0)