Skip to content

Commit

Permalink
Fix issue with trying to parse "Not Scheduled" as timestamp
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisTheBaron committed Dec 4, 2016
1 parent d739a22 commit ade153f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
8 changes: 5 additions & 3 deletions season.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,11 @@ func (s *Session) GetTimeslotsForSeason(id int) (timeslots []Timeslot, err error
}
for k, v := range timeslots {
timeslots[k].Time = time.Unix(v.TimeRaw, 0)
timeslots[k].FirstTime, err = time.Parse("02/01/2006 15:04", v.FirstTimeRaw)
if err != nil {
return
if v.FirstTimeRaw != "Not Scheduled" {
timeslots[k].FirstTime, err = time.Parse("02/01/2006 15:04", v.FirstTimeRaw)
if err != nil {
return
}
}
timeslots[k].Submitted, err = time.Parse("02/01/2006 15:04", v.SubmittedRaw)
if err != nil {
Expand Down
8 changes: 5 additions & 3 deletions show.go
Original file line number Diff line number Diff line change
Expand Up @@ -113,9 +113,11 @@ func (s *Session) GetSeasons(id int) (seasons []Season, err error) {
return
}
for k, v := range seasons {
seasons[k].FirstTime, err = time.Parse("02/01/2006 15:04", v.FirstTimeRaw)
if err != nil {
return
if v.FirstTimeRaw != "Not Scheduled" {
seasons[k].FirstTime, err = time.Parse("02/01/2006 15:04", v.FirstTimeRaw)
if err != nil {
return
}
}
seasons[k].Submitted, err = time.Parse("02/01/2006 15:04", v.SubmittedRaw)
if err != nil {
Expand Down

0 comments on commit ade153f

Please sign in to comment.