v0.0.509
All checks were successful
Build Docker and Deploy / Run goext test-suite (push) Successful in 6m2s

This commit is contained in:
2024-08-26 14:35:49 +02:00
parent 3320a9c19d
commit 3a17edfaf0
5 changed files with 136 additions and 2 deletions

View File

@@ -184,3 +184,10 @@ func AddYears(t time.Time, yearCount float64, tz *time.Location) time.Time {
return t.Add(time.Duration(float64(t1.Sub(t0)) * floatCount))
}
func DaysInMonth(t time.Time) int {
// https://stackoverflow.com/a/73882035/1761622
y, m, _ := t.Date()
return time.Date(y, m+1, 0, 0, 0, 0, 0, time.UTC).Day()
}