feat: Added the ability to skip times that are not present
This commit is contained in:
parent
6de2ce9815
commit
8fe0b3ce53
@ -35,6 +35,11 @@ func (s Schedule) CurrentCourse() (string, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
for courseName, courseInfo := range s.Courses {
|
for courseName, courseInfo := range s.Courses {
|
||||||
|
// Skip times that are TBD
|
||||||
|
if courseInfo.StartTime == "TBD" || courseInfo.EndTime == "TBD" {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
startTime, err := time.Parse(time.Kitchen, courseInfo.StartTime)
|
startTime, err := time.Parse(time.Kitchen, courseInfo.StartTime)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return "", err
|
return "", err
|
||||||
|
Loading…
Reference in New Issue
Block a user