fix: calc worktime, when nothing is set
Some checks failed
Tests / Run Go Tests (push) Failing after 1m32s

This commit is contained in:
2026-02-15 18:30:28 +01:00
parent 23896e4f08
commit 10df10a606
3 changed files with 10 additions and 10 deletions

View File

@@ -85,7 +85,7 @@ func (d *WorkDay) GetTimes(u User, base WorktimeBase, includeKurzarbeit bool) (w
func getWorkPause(d *WorkDay) (work, pause time.Duration) {
//if today calc, else take from db
if helper.IsSameDate(d.Date(), time.Now()) {
if d.workTime == 0 && d.pauseTime == 0 && len(d.Bookings) > 0 {
return calcWorkPause(d.Bookings)
} else {
return d.workTime, d.pauseTime