lines = [];
+
+ // read the lines, and fill in the 'spans'
+
for (var i = 0; i < flines.length; i++) {
var xl = flines[i].split(/([0-9]{2}:[0-9]{2}:[0-9]{2})/);
//print(JSON.stringify(xl));
lines.push( this.parseLine(xl[ii] + ' ' + xl[ii+1]));
if (p > 0) {
lines[p-1].span = lines[p].start - lines[p-1].start; // should be seconds..?
+ lines[p-1].spanMin = lines[p-1].span/60000;
+
+
}
}
for (var i = 0; i < lines.length; i++) {
var line = lines[i];
var hour = line.start.format('H');
+
+ if (line.project == 'IDLE' && line.spanMin >= 5 ) {
+ line.project = 'LONGIDLE';
+ }
+
var project = line.project;
hours[hour] = (typeof(hours[hour]) == 'undefined') ? {} : hours[hour];
hours[hour][project] = (typeof(hours[hour][project]) == 'undefined') ?
for (var h in res) {
for (var p in res[h]) {
if (p == 'IDLE') {
+ var idletime = Math.floor(res[h][p].total/60000) ;
print(h + ' ' + Math.floor(res[h][p].total/60000) +'m IDLE' );
- totals.idle += Math.floor(res[h][p].total/60000) ;
+ if (idletime > 5) {
+ totals.idle += idletime;
+ }
+
continue;
}
print(h + ' ' + Math.floor(res[h][p].total/60000) +'m ' + p );
}
}
-print("IDLE : " + Math.floor(total.idle/60) +"h\n" );
-print("Worked: " + Math.floor(total.work/60) +"h\n" );
-print(JSON.stringify(totals,null,4));
+print("\nIDLE : " +(totals.idle/60).toFixed(2) +"h" );
+print("Worked: " + (totals.work/60).toFixed(2) +"h\n" );
+
// open file..