1
0
Fork 0
mirror of https://github.com/gocsaf/csaf.git synced 2025-12-22 11:55:40 +01:00

Fixed switched time.Parse args.

This commit is contained in:
Sascha L. Teichmann 2023-07-26 10:52:20 +02:00
parent 5e6fb8241c
commit eade9f7ae4

View file

@ -38,7 +38,7 @@ func guessDate(s string) (time.Time, bool) {
"2006-01", "2006-01",
"2006", "2006",
} { } {
if t, err := time.Parse(s, layout); err == nil { if t, err := time.Parse(layout, s); err == nil {
return t, true return t, true
} }
} }
@ -66,6 +66,7 @@ func (tr *TimeRange) UnmarshalText(text []byte) error {
return fmt.Errorf("%q is not a valid RFC date time", a) return fmt.Errorf("%q is not a valid RFC date time", a)
} }
*tr = NewTimeInterval(start, time.Now()) *tr = NewTimeInterval(start, time.Now())
return nil
} }
// Real interval // Real interval
start, ok := guessDate(a) start, ok := guessDate(a)