mirror of
https://github.com/stashapp/stash.git
synced 2025-12-18 04:44:37 +03:00
Bugfix: Add extra date formats. (#6305)
This commit is contained in:
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user