Add 3-Day Outlook generation
This commit is contained in:
@@ -24,6 +24,21 @@ func (p Period) Contains(t time.Time) bool {
|
||||
return !t.Before(p.Start) && t.Before(p.End)
|
||||
}
|
||||
|
||||
func (p Period) Intersection(other Period) (Period, bool) {
|
||||
if !p.Overlaps(other) {
|
||||
return Period{}, false
|
||||
}
|
||||
start := p.Start
|
||||
if other.Start.After(start) {
|
||||
start = other.Start
|
||||
}
|
||||
end := p.End
|
||||
if other.End.Before(end) {
|
||||
end = other.End
|
||||
}
|
||||
return Period{Start: start, End: end}, true
|
||||
}
|
||||
|
||||
func ParseClock(value string) (time.Duration, error) {
|
||||
parts := strings.Split(value, ":")
|
||||
if len(parts) != 2 {
|
||||
|
||||
Reference in New Issue
Block a user