closed #25, #32
All checks were successful
GoLang Tests / Run Go Tests (push) Successful in 49s

This commit is contained in:
2025-09-04 21:22:26 +02:00
parent 0dd75c2126
commit 9ded540314
18 changed files with 224 additions and 119 deletions

View File

@@ -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
}