seperated create abwesenheit button + added first part of frontend logic

This commit is contained in:
2025-04-02 10:44:55 +02:00
parent 0c33ae22bf
commit e60f19ee27
5 changed files with 226 additions and 241 deletions

View File

@@ -101,12 +101,7 @@ func (d *WorkDay) GetWorkDays(card_uid string, tsFrom, tsTo time.Time) []WorkDay
workDay.calcPauseTime()
}
//TODO: remove
if len(workDay.Bookings) == 1 && workDay.Bookings[0].CounterId == 0 {
log.Println("No booking")
} else {
workDays = append(workDays, workDay)
}
workDays = append(workDays, workDay)
}
if err = rows.Err(); err != nil {
return workDays
@@ -130,6 +125,9 @@ func (d *WorkDay) calcPauseTime() {
// Gets the duration someone worked that day
func (d *WorkDay) getWorkTime() {
if len(d.Bookings) <= 1 && d.Bookings[0].CounterId == 0 {
return
}
var workTime, pauseTime time.Duration
var lastBooking Booking
for _, booking := range d.Bookings {