From: Alan Knowles Date: Mon, 3 Apr 2017 03:42:32 +0000 (+0800) Subject: GitLogParser.js X-Git-Url: http://git.roojs.org/?p=gitlive;a=commitdiff_plain;h=6c373fcb9a5dd5695db79b179d36d7c309575aa7 GitLogParser.js --- diff --git a/GitLogParser.js b/GitLogParser.js index 5ad4c928..e6302f56 100644 --- a/GitLogParser.js +++ b/GitLogParser.js @@ -254,10 +254,17 @@ for (var h in GitLogParser.shours) { print (" " + r.tot + " : " + r.desc); }); } - -for (var desc in totals) { - print (" " + totals[desc] + " : " + desc); +print("\n\n" + h+': Totals (' + htot +')'); + +var hsum = []; +for (var desc in totals) { + hsum.push({ desc : desc, tot : totals[desc] }); } +hsum.sort(function(a,b) { if (a.tot == b.tot) { return 0; } return a.tot < b.tot ? 1 : -1 }); +print("\n\nDay Total (" + htot +')'); +hsum.forEach(function(r) { + print (" " + r.tot + " : " + r.desc); +}); //print(JSON.stringify(GitLogParser.shours,null,4));