GitLogParser = {
shours : false,
-
+ date : false,
parse : function(date)
{
-
+ var filename = date;
if (typeof(date) == 'object') {
- this.date = date;
- var home = GLib.get_home_dir();
- print( "READING FILE");
- var flines = File.read( home + '/.gitlog' + date.format('/Y/m/d') + '.log').split("\n");
- print("loaded");
+ this.date = date;
+ var home = GLib.get_home_dir();
+ //print( "READING FILE");
+ filename = home + '/.gitlog' + date.format('/Y/m/d') + '.log';
+
+
+ }
+ var flines = File.read( filename ).split("\n");
+ //print("loaded");
// first just convert them..
// we had an old bug that did not put line breaks in there..
// however 00:00:00: is pretty distinct, so let'st try and split on it..
//print("time: " + time);
//ret.start = xDate.Date.parseDate(this.date.format('Y-m-d') + ' ' + time, 'Y-m-d H:i:s');
- ret.start = xDate.Date.parseDate((
- this.date ? this.date.format('Y-m-d') : (new Date()).format('Y-m-d') +
+ ret.start = xDate.Date.parseDate(
+ (this.date ? this.date.format('Y-m-d') : (new xDate.Date()).format('Y-m-d')) +
' ' + time, 'Y-m-d H:i:s');
while (ret.cmd === false) {
}
}
+
+
+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" );
+
+
+
for (var h in GitLogParser.shours) {
var hsum = [];
var htot = 0;
-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" );
-
-
// open file..
// read lines