mirror of
https://github.com/araddon/dateparse.git
synced 2025-01-19 11:16:12 +08:00
So people don't have to check the string they can use the new errors.Is function
This commit is contained in:
parent
c5a1edc710
commit
268a690081
@ -134,10 +134,11 @@ var (
|
||||
// ErrAmbiguousMMDD for date formats such as 04/02/2014 the mm/dd vs dd/mm are
|
||||
// ambiguous, so it is an error for strict parse rules.
|
||||
ErrAmbiguousMMDD = fmt.Errorf("this date has ambiguous mm/dd vs dd/mm type format")
|
||||
ErrCouldntFindFormat = fmt.Errorf("could not find format for")
|
||||
)
|
||||
|
||||
func unknownErr(datestr string) error {
|
||||
return fmt.Errorf("Could not find format for %q", datestr)
|
||||
return fmt.Errorf("%w %q", ErrCouldntFindFormat, datestr)
|
||||
}
|
||||
|
||||
// ParseAny parse an unknown date format, detect the layout.
|
||||
|
Loading…
Reference in New Issue
Block a user