This commit is contained in:
@@ -203,11 +203,15 @@ func (d *WorkDay) GetWorkDayProgress(user User) uint8 {
|
||||
}
|
||||
|
||||
func (d *WorkDay) CalcOvertime(user User) time.Duration {
|
||||
if helper.IsWeekend(d.Day) && len(d.Bookings) == 0 {
|
||||
return 0
|
||||
}
|
||||
var overtime time.Duration
|
||||
overtime = d.workTime - time.Duration(user.ArbeitszeitPerTag*float32(time.Hour)).Round(time.Minute)
|
||||
// weekday is WE
|
||||
if (d.Day.Weekday() == 6 || d.Day.Weekday() == 0) && len(d.Bookings) == 0 {
|
||||
if (d.Absence != Absence{}) {
|
||||
overtime = 0
|
||||
}
|
||||
|
||||
return overtime
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user