fixed minor bugs + added loggin middleware
All checks were successful
Tests / Run Go Tests (push) Successful in 1m26s
All checks were successful
Tests / Run Go Tests (push) Successful in 1m26s
This commit is contained in:
@@ -49,19 +49,16 @@ func GetDays(user User, tsFrom, tsTo time.Time, orderedForward bool) []IWorkDay
|
||||
}
|
||||
|
||||
for _, absentDay := range absences {
|
||||
// Kurzarbeit should be integrated in workday
|
||||
|
||||
// Check if there is already a day
|
||||
existingDay, ok := allDays[absentDay.Date().Format(time.DateOnly)]
|
||||
if !ok {
|
||||
allDays[absentDay.Date().Format(time.DateOnly)] = &absentDay
|
||||
continue
|
||||
}
|
||||
switch {
|
||||
case absentDay.AbwesenheitTyp.WorkTime < 0:
|
||||
if workDay, ok := allDays[absentDay.Date().Format(time.DateOnly)].(*WorkDay); ok {
|
||||
workDay.kurzArbeit = true
|
||||
workDay.kurzArbeitAbsence = absentDay
|
||||
}
|
||||
case !existingDay.IsEmpty():
|
||||
case ok && !existingDay.IsEmpty():
|
||||
allDays[absentDay.Date().Format(time.DateOnly)] = NewCompondDay(absentDay.Date(), existingDay, &absentDay)
|
||||
default:
|
||||
allDays[absentDay.Date().Format(time.DateOnly)] = &absentDay
|
||||
|
||||
Reference in New Issue
Block a user