feat: Added the ability to skip times that are not present

This commit is contained in:
Nicholas Novak 2024-01-18 16:39:12 -08:00
parent 6de2ce9815
commit 8fe0b3ce53

View File

@ -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