separaded endpoints + cleaned page templates + added constants to time formatting
Some checks failed
Tests / Run Go Tests (push) Failing after 1m34s
Some checks failed
Tests / Run Go Tests (push) Failing after 1m34s
This commit is contained in:
@@ -41,7 +41,7 @@ func GetDays(user User, tsFrom, tsTo time.Time, orderedForward bool) []IWorkDay
|
||||
var allDays map[string]IWorkDay = make(map[string]IWorkDay)
|
||||
|
||||
for _, day := range GetWorkDays(user, tsFrom, tsTo) {
|
||||
allDays[day.Date().Format("2006-01-02")] = &day
|
||||
allDays[day.Date().Format(time.DateOnly)] = &day
|
||||
}
|
||||
absences, err := GetAbsencesByCardUID(user.CardUID, tsFrom, tsTo)
|
||||
if err != nil {
|
||||
@@ -53,12 +53,12 @@ func GetDays(user User, tsFrom, tsTo time.Time, orderedForward bool) []IWorkDay
|
||||
continue
|
||||
}
|
||||
if day.AbwesenheitTyp.WorkTime == 1 {
|
||||
if workDay, ok := allDays[day.Date().Format("2006-01-02")].(*WorkDay); ok && len(workDay.Bookings) > 0 {
|
||||
if workDay, ok := allDays[day.Date().Format(time.DateOnly)].(*WorkDay); ok && len(workDay.Bookings) > 0 {
|
||||
workDay.kurzArbeit = true
|
||||
workDay.kurzArbeitAbsence = day
|
||||
}
|
||||
} else {
|
||||
allDays[day.Date().Format("2006-01-02")] = &day
|
||||
allDays[day.Date().Format(time.DateOnly)] = &day
|
||||
}
|
||||
}
|
||||
|
||||
@@ -165,7 +165,7 @@ func (d *WorkDay) TimePauseReal(u User) (work, pause time.Duration) {
|
||||
}
|
||||
|
||||
func (d *WorkDay) ToString() string {
|
||||
return fmt.Sprintf("WorkDay: %s with %d bookings and worktime: %s", d.Date().Format("2006-01-02"), len(d.Bookings), helper.FormatDuration(d.workTime))
|
||||
return fmt.Sprintf("WorkDay: %s with %d bookings and worktime: %s", d.Date().Format(time.DateOnly), len(d.Bookings), helper.FormatDuration(d.workTime))
|
||||
}
|
||||
|
||||
func (d *WorkDay) IsWorkDay() bool {
|
||||
|
||||
Reference in New Issue
Block a user