Skip to content

Commit 694fafa

Browse files
author
Andreas Müller
committed
gtt log: show unsynced / incompletely synced times yellow
1 parent 7434c75 commit 694fafa

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/gtt-log.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,10 @@ tasks.log()
4646
frames[date]
4747
.sort((a, b) => a.start.isBefore(b.start) ? -1 : 1)
4848
.forEach(frame => {
49+
let toSync = (Math.ceil(frame.duration) - parseInt(_.reduce(frame.notes, (n, m) => (n + m.time), 0))) != 0;
50+
let durationText = toSync ? toHumanReadable(frame.duration).yellow : toHumanReadable(frame.duration);
4951
let issue = frame.resource.new ? `new ${frame.resource.type + ' "' + frame.resource.id.blue}"` : `${(frame.resource.type + ' #' + frame.resource.id).blue}`;
50-
console.log(` ${frame.id} ${frame.start.clone().format('HH:mm').green} to ${frame.stop.clone().format('HH:mm').green}\t${toHumanReadable(frame.duration)}\t\t${frame.project.magenta}\t\t${issue}`)
52+
console.log(` ${frame.id} ${frame.start.clone().format('HH:mm').green} to ${frame.stop.clone().format('HH:mm').green}\t${durationText}\t\t${frame.project.magenta}\t\t${issue}`)
5153
});
5254
});
5355
}

0 commit comments

Comments
 (0)