This commit is contained in:
@@ -24,15 +24,16 @@ type IWorkDay interface {
|
||||
}
|
||||
|
||||
type WorkDay struct {
|
||||
Day time.Time `json:"day"`
|
||||
Bookings []Booking `json:"bookings"`
|
||||
workTime time.Duration
|
||||
pauseTime time.Duration
|
||||
realWorkTime time.Duration
|
||||
realPauseTime time.Duration
|
||||
TimeFrom time.Time
|
||||
TimeTo time.Time
|
||||
kurzArbeit bool
|
||||
Day time.Time `json:"day"`
|
||||
Bookings []Booking `json:"bookings"`
|
||||
workTime time.Duration
|
||||
pauseTime time.Duration
|
||||
realWorkTime time.Duration
|
||||
realPauseTime time.Duration
|
||||
TimeFrom time.Time
|
||||
TimeTo time.Time
|
||||
kurzArbeit bool
|
||||
kurzArbeitAbsence Absence
|
||||
}
|
||||
|
||||
func GetDays(user User, tsFrom, tsTo time.Time, orderedForward bool) []IWorkDay {
|
||||
@@ -53,6 +54,7 @@ func GetDays(user User, tsFrom, tsTo time.Time, orderedForward bool) []IWorkDay
|
||||
if day.AbwesenheitTyp.WorkTime == 1 {
|
||||
if workDay, ok := allDays[day.Date().Format("2006-01-02")].(*WorkDay); ok {
|
||||
workDay.kurzArbeit = true
|
||||
workDay.kurzArbeitAbsence = day
|
||||
}
|
||||
} else {
|
||||
allDays[day.Date().Format("2006-01-02")] = &day
|
||||
@@ -85,6 +87,10 @@ func (d *WorkDay) TimeWorkVirtual(u User) time.Duration {
|
||||
return d.workTime
|
||||
}
|
||||
|
||||
func (d *WorkDay) GetKurzArbeit() Absence {
|
||||
return d.kurzArbeitAbsence
|
||||
}
|
||||
|
||||
func (d *WorkDay) TimeWorkReal(u User) time.Duration {
|
||||
d.realWorkTime, d.realPauseTime = 0, 0
|
||||
var lastBooking Booking
|
||||
|
||||
Reference in New Issue
Block a user