diff options
| author | Maciej Borzecki <maciej.zenon.borzecki@canonical.com> | 2017-12-19 12:11:19 +0100 |
|---|---|---|
| committer | Maciej Borzecki <maciej.zenon.borzecki@canonical.com> | 2017-12-19 12:11:19 +0100 |
| commit | f144537687b8daea3865e3507d618e69d443e059 (patch) | |
| tree | e0bf0d15eef89534d819f911976c6ea95b73dc87 /timeutil | |
| parent | 0b363be8206e8e110b3b0b6cdbe8c5780ae88862 (diff) | |
timeutil: address review feedback (thanks @stolowski)
Signed-off-by: Maciej Borzecki <maciej.zenon.borzecki@canonical.com>
Diffstat (limited to 'timeutil')
| -rw-r--r-- | timeutil/schedule.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/timeutil/schedule.go b/timeutil/schedule.go index 4e7da4712f..32f91f4c9c 100644 --- a/timeutil/schedule.go +++ b/timeutil/schedule.go @@ -68,7 +68,7 @@ func (t Clock) Time(base time.Time) time.Time { } // ParseClock parses a string that contains hour:minute and returns -// an Clock type or an error +// a Clock type or an error func ParseClock(s string) (t Clock, err error) { m := validTime.FindStringSubmatch(s) if len(m) == 0 { @@ -284,7 +284,7 @@ type ScheduleWindow struct { // Includes returns whether t falls inside the window. func (s ScheduleWindow) Includes(t time.Time) bool { - return (t.Equal(s.Start) || t.After(s.Start)) && (t.Equal(s.End) || t.Before(s.End)) + return !(t.Before(s.Start) || t.After(s.End)) } // IsZero returns whether s is uninitialized. |
