+//print(Seed.argv[2]);Seed.quit();
+if (typeof(Seed.argv[2]) == 'undefined') {
+ print("pick a date");
+ Seed.quit();
+}
+
+var res = GitLogParser.parse( Seed.argv[2][0] == '/' ? Seed.argv[2] : xDate.Date.parseDate(Seed.argv[2], 'Y-m-d'));
+var totals = { work : 0 , idle: 0, shortidle : 0};
+var unknown = [];
+for (var h in res) {
+ for (var p in res[h]) {
+ if (p == 'LONGIDLE') {
+ var idletime = Math.floor(res[h][p].total/60000) ;
+ //print(h + ' ' + Math.floor(res[h][p].total/60000) +'m LONGIDLE' );
+ totals.idle += idletime;
+
+
+ continue;
+ }
+ if (p == 'IDLE') {
+ var idletime = Math.floor(res[h][p].total/60000) ;
+ //print(h + ' ' + Math.floor(res[h][p].total/60000) +'m SHORT IDLE' );
+ totals.shortidle += idletime;
+
+
+ continue;
+ }
+
+
+ //print(h + ' ' + Math.floor(res[h][p].total/60000) +'m ' + p );
+ totals.work += Math.floor(res[h][p].total/60000) ;
+
+ if (h == -1) {
+
+ print( "\n" + p + ':' + Math.floor(res[h][p].total/60000) + 'm');
+
+ 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 }) ;
+
+
+ }
+ }
+ }
+
+ }
+
+}
+
+
+print("\nLONGIDLE : " +(totals.idle/60).toFixed(2) +"h" );
+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 = [];
+ var htot = 0;
+ 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 +')');
+ hsum.forEach(function(r) {
+ var pr = r.desc.match(/IDLE/) ? '' : (GitLogParser.match_project(r.desc) == "Unknown" ? '??? - ' : '');
+
+ print (" " + r.tot + " : " + pr + r.desc);
+ });
+}
+
+
+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);
+});
+
+//print(JSON.stringify(GitLogParser.shours,null,4));
+