updates to changeover and tests

This commit is contained in:
2022-04-03 22:33:50 -07:00
parent 0f88864200
commit 88ce350a61
5 changed files with 312 additions and 6 deletions

View File

@@ -61,7 +61,9 @@ func GetDuration(start time.Time, end time.Time) (dur time.Duration, err error)
func ValidTimePeriods(ts time.Time, periods ...Period) []Period {
var valid []Period
for _, p := range periods {
if p.GetStartTime().Before(ts) && p.GetEndTime().After(ts) {
start := p.GetStartTime()
end := p.GetEndTime()
if (start.Before(ts) || start.Equal(ts)) && (end.After(ts)) {
valid = append(valid, p)
}
}