cleanup/small refactor + first tests

This commit is contained in:
2025-07-17 19:28:21 +02:00
parent 6688128d30
commit 68000a0f0a
6 changed files with 99 additions and 61 deletions

16
Backend/helper/time.go Normal file
View File

@@ -0,0 +1,16 @@
package helper
import (
"time"
)
func GetMonday(ts time.Time) time.Time {
if ts.Weekday() != time.Monday {
if ts.Weekday() == time.Sunday {
return ts.AddDate(0, 0, -6)
} else {
return ts.AddDate(0, 0, -int(ts.Weekday()-1))
}
}
return ts
}