mirror of
https://github.com/gocsaf/csaf.git
synced 2025-12-22 11:55:40 +01:00
Add time interval filtering to downloader.
This commit is contained in:
parent
0e297fc616
commit
de0599ebe3
4 changed files with 36 additions and 12 deletions
|
|
@ -79,3 +79,8 @@ func (tr *TimeRange) UnmarshalText(text []byte) error {
|
|||
*tr = NewTimeInterval(start, end)
|
||||
return nil
|
||||
}
|
||||
|
||||
// Contains return true if the given time is inside this time interval.
|
||||
func (tr TimeRange) Contains(t time.Time) bool {
|
||||
return !(t.Before(tr[0]) || t.After(tr[1]))
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue