Added sorting to schedule

This commit is contained in:
Eduard Urbach 2017-06-28 21:32:13 +02:00
parent 2f5fa949f4
commit b90603be89

View File

@ -1,6 +1,7 @@
package dashboard package dashboard
import ( import (
"sort"
"time" "time"
"github.com/aerogo/aero" "github.com/aerogo/aero"
@ -84,6 +85,10 @@ func dashboard(ctx *aero.Context) string {
} }
} }
} }
sort.Slice(upcomingEpisodes, func(i, j int) bool {
return upcomingEpisodes[i].Episode.AiringDate.Start < upcomingEpisodes[j].Episode.AiringDate.Start
})
}, func() { }, func() {
var err error var err error
soundTracks, err = arn.AllSoundTracks() soundTracks, err = arn.AllSoundTracks()