From 08ce2b04ec66669e3315be8f77dbf03459880068 Mon Sep 17 00:00:00 2001 From: Alan Knowles Date: Mon, 3 Apr 2017 11:40:29 +0800 Subject: [PATCH] GitLogParser.js --- GitLogParser.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/GitLogParser.js b/GitLogParser.js index aa3fd8ad..de19111a 100644 --- a/GitLogParser.js +++ b/GitLogParser.js @@ -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 +')'); -- 2.39.2