GitLogParser.js
[gitlive] / GitLogParser.js
index 807f98f..6c29d40 100644 (file)
@@ -258,15 +258,25 @@ for (var h in res) {
         
         //print(h + ' ' + Math.floor(res[h][p].total/60000) +'m ' + p );  
         totals.work += Math.floor(res[h][p].total/60000) ;
-        
+        var unknown = [];
         if (h == -1) {
             
-            print( "\n" + p + ':');
+            print( "\n" + p + ':' + Math.floor(res[h][p].total/60000) + 'm');
             
-            for (var k in res[h][p].items) {
-                 
-                print( '     ' + Math.floor(res[h][p].items[k]/60000) +'m ' + k );
+            if (p != 'Unknown') {
+        
+                for (var k in res[h][p].items) {
                      
+                    print( '     ' + Math.floor(res[h][p].items[k]/60000) +'m ' + k );
+                         
+                }
+            } else {
+                
+                for (var k in res[h][p].items) {
+                    unknown.push({ desc : k , tot : (res[h][p].items[k]/60000).toFixed(2)*1 }) ;
+                    
+                         
+                }
             }
         }
         
@@ -296,15 +306,11 @@ for (var h in GitLogParser.shours) {
         print ("  " + r.tot + "   : " + r.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");
-hsum.forEach(function(r) {
+unknown.sort(function(a,b) { if (a.tot == b.tot) { return 0; } return a.tot < b.tot ? 1 : -1 });
+print("\n\nUnclassified");
+unknown.forEach(function(r) {
     print ("  " + (r.tot.toFixed(2)*1) + "   : " + r.desc);
 });