added helper function, and fixed #28
All checks were successful
Tests / Run Go Tests (push) Successful in 29s

This commit is contained in:
2025-09-05 22:24:42 +02:00
parent de03c100d4
commit 12ed9959cb

View File

@@ -20,6 +20,11 @@ func IsWeekend(ts time.Time) bool {
return ts.Weekday() == time.Saturday || ts.Weekday() == time.Sunday return ts.Weekday() == time.Saturday || ts.Weekday() == time.Sunday
} }
func GetKW(t time.Time) int {
_, kw := t.ISOWeek()
return kw
}
// Converts duration to string // Converts duration to string
func FormatDuration(d time.Duration) string { func FormatDuration(d time.Duration) string {
hours := int(d.Abs().Hours()) hours := int(d.Abs().Hours())