marshal time.Duration as json string

This commit is contained in:
glidea
2025-05-06 16:00:59 +08:00
parent 8f32e427d4
commit 278cb662de
8 changed files with 86 additions and 26 deletions

View File

@@ -55,7 +55,7 @@ const maxPast = 15 * 24 * time.Hour
func (c *Config) Validate() error {
if c.Past <= 0 {
c.Past = 3 * timeutil.Day
c.Past = timeutil.Day
}
if c.Past > maxPast {
c.Past = maxPast