GitLogParser.js
authorAlan Knowles <alan@roojs.com>
Mon, 3 Apr 2017 03:40:29 +0000 (11:40 +0800)
committerAlan Knowles <alan@roojs.com>
Mon, 3 Apr 2017 03:40:29 +0000 (11:40 +0800)
GitLogParser.js

index aa3fd8a..de19111 100644 (file)
@@ -238,7 +238,7 @@ print("\nShort Idle : " +(totals.shortidle/60).toFixed(2) +"h" );
 
 print("Worked: " + (totals.work/60).toFixed(2) +"h\n" );
  
-
+var totals = {};
 
 for (var h in GitLogParser.shours) {
     var hsum = [];
@@ -246,6 +246,7 @@ for (var h in GitLogParser.shours) {
     for (var desc in GitLogParser.shours[h]) {
         htot += (GitLogParser.shours[h][desc]/60000).toFixed(2)*1;
         hsum.push({ desc : desc, tot : (GitLogParser.shours[h][desc]/60000).toFixed(2)*1 })
+        totals[desc] = (typeof(totals[desc]) == 'undefined' ? 0 : totals[desc]) + ((GitLogParser.shours[h][desc]/60000).toFixed(2)*1);
     }
     hsum.sort(function(a,b) { if (a.tot == b.tot) { return 0; } return a.tot < b.tot ? 1 : -1 });
     print("\n\n" + h+': Total (' + htot +')');