Bugfix: Add extra date formats. (#6305)

This commit is contained in:
Gykes
2025-11-24 13:17:51 -08:00
committed by GitHub
parent 58b6833380
commit 2cac7d5b20
2 changed files with 92 additions and 0 deletions

View File

@@ -23,5 +23,17 @@ func ParseDateStringAsTime(dateString string) (time.Time, error) {
return t, nil
}
// Support partial dates: year-month format
t, e = time.Parse("2006-01", dateString)
if e == nil {
return t, nil
}
// Support partial dates: year only format
t, e = time.Parse("2006", dateString)
if e == nil {
return t, nil
}
return time.Time{}, fmt.Errorf("ParseDateStringAsTime failed: dateString <%s>", dateString)
}