added Gleitzeit + Kurzarbeit closes #23
All checks were successful
Tests / Run Go Tests (push) Successful in 33s

This commit is contained in:
2025-09-13 14:12:39 +02:00
parent ccded6d76b
commit 2d0b117403
18 changed files with 298 additions and 255 deletions

View File

@@ -25,8 +25,12 @@ func GetKW(t time.Time) int {
return kw
}
// Converts duration to string
func FormatDuration(d time.Duration) string {
return FormatDurationFill(d, false)
}
// Converts duration to string
func FormatDurationFill(d time.Duration, fill bool) string {
hours := int(d.Abs().Hours())
minutes := int(d.Abs().Minutes()) % 60
sign := ""
@@ -41,6 +45,13 @@ func FormatDuration(d time.Duration) string {
case minutes > 0:
return fmt.Sprintf("%s%dmin", sign, minutes)
default:
if fill {
return "0min"
}
return ""
}
}
func IsSameDate(a, b time.Time) bool {
return a.Truncate(24 * time.Hour).Equal(b.Truncate(24 * time.Hour))
}