mirror of
https://github.com/gocsaf/csaf.git
synced 2025-12-22 18:15:42 +01:00
Fixed switched time.Parse args.
This commit is contained in:
parent
5e6fb8241c
commit
eade9f7ae4
1 changed files with 2 additions and 1 deletions
|
|
@ -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)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue