using IWorkDay interface for team
All checks were successful
Tests / Run Go Tests (push) Successful in 42s
All checks were successful
Tests / Run Go Tests (push) Successful in 42s
This commit is contained in:
@@ -4,7 +4,6 @@ import (
|
||||
"database/sql"
|
||||
"errors"
|
||||
"log"
|
||||
"sort"
|
||||
"time"
|
||||
)
|
||||
|
||||
@@ -46,10 +45,7 @@ func NewWorkWeek(user User, tsMonday time.Time, populate bool) WorkWeek {
|
||||
}
|
||||
|
||||
func (w *WorkWeek) PopulateWithDays(worktime time.Duration, overtime time.Duration) {
|
||||
w.Days = GetDays(w.User, w.WeekStart, w.WeekStart.Add(6*24*time.Hour))
|
||||
sort.Slice(w.Days, func(i, j int) bool {
|
||||
return w.Days[i].Date().Before(w.Days[j].Date())
|
||||
})
|
||||
w.Days = GetDays(w.User, w.WeekStart, w.WeekStart.Add(6*24*time.Hour), false)
|
||||
|
||||
for _, day := range w.Days {
|
||||
w.Worktime += day.TimeWorkVirtual(w.User)
|
||||
|
||||
Reference in New Issue
Block a user