Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
print warnings when working much over hoursPerDay
  • Loading branch information
Andreas Müller committed Jul 26, 2022
commit d66ad7811ced2c0fe30de6696a4427d5a9425b7b
15 changes: 14 additions & 1 deletion src/gtt-log.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,21 @@ tasks.log()
.then(({frames, times}) => {
Object.keys(frames).sort().forEach(date => {
if (!frames.hasOwnProperty(date)) return;
let dayNote = "";
let hpd = config.get('hoursPerDay');
if(times[date] > hpd*3600*2)
{
dayNote = ` - worked over ${hpd*2} hours`.red;
}else if(times[date] > hpd*3600*1.5)
{
dayNote = ` - worked over ${hpd*1.5} hours`.orange;
}else if(times[date] > hpd*3600*1.1)
{
dayNote = ` - worked over ${hpd*1.1} hours`.green;
}


console.log(`${moment(date).format('MMMM Do YYYY')} (${toHumanReadable(times[date])})`.green);
console.log(`${moment(date).format('MMMM Do YYYY')} (${toHumanReadable(times[date])})`.green + dayNote);
frames[date]
.sort((a, b) => a.start.isBefore(b.start) ? -1 : 1)
.forEach(frame => {
Expand Down