empty string period is inf
All checks were successful
cicd / ci (push) Successful in 2m36s

This commit is contained in:
Bel LaPointe
2026-03-04 08:14:07 -07:00
parent 7262f5f69b
commit 86b8e62862
2 changed files with 6 additions and 2 deletions

View File

@@ -74,6 +74,10 @@ func (period *Period) setStop(s string) error {
}
func (*Period) setT(s string, t *time.Time) (time.Time, error) {
if s == "" {
*t = time.Unix(0, 0)
return time.Now().AddDate(100, 0, 0), nil
}
if result, err := time.Parse("2006", s); err == nil {
*t = result
return result.AddDate(1, 0, 0).Add(-1 * time.Minute), nil