Skip to content

Commit d66ad78

Browse files
author
Andreas Müller
committed
print warnings when working much over hoursPerDay
1 parent 2297854 commit d66ad78

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

src/gtt-log.js

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,21 @@ tasks.log()
2828
.then(({frames, times}) => {
2929
Object.keys(frames).sort().forEach(date => {
3030
if (!frames.hasOwnProperty(date)) return;
31+
let dayNote = "";
32+
let hpd = config.get('hoursPerDay');
33+
if(times[date] > hpd*3600*2)
34+
{
35+
dayNote = ` - worked over ${hpd*2} hours`.red;
36+
}else if(times[date] > hpd*3600*1.5)
37+
{
38+
dayNote = ` - worked over ${hpd*1.5} hours`.orange;
39+
}else if(times[date] > hpd*3600*1.1)
40+
{
41+
dayNote = ` - worked over ${hpd*1.1} hours`.green;
42+
}
43+
3144

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

0 commit comments

Comments
 (0)