Update caste.go

This commit is contained in:
Valera 2020-09-16 23:04:35 +03:00 committed by GitHub
parent e85dcc8b38
commit 157e4947bf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 3 deletions

View File

@ -1272,9 +1272,10 @@ func parseDateWith(s string, dates []string) (d time.Time, e error) {
if d, e = time.Parse(dateType, s); e == nil {
return
}
}
if i, err := strconv.Atoi(t); err == nil {
return time.Unix(int64(i), 0), nil
if i, err := strconv.Atoi(dateType); err == nil {
return time.Unix(int64(i), 0), nil
}
}
return d, fmt.Errorf("unable to parse date: %s", s)