boghammar / MMM-SL-PublicTransport

Magic Mirror module - Display public transport in Stockholm/Sweden.
MIT License
12 stars 6 forks source link

Sort order is sometimes wrong #14

Closed boghammar closed 7 years ago

boghammar commented 7 years ago

The departure array is collected in the node_helper by simply adding the different transport methods (buss, train ...) one by one and then do a sort on JourneyDirection. This messes up the ordering by departure time.

Instead create one array for each direction sort these on departure time (if necessary, maybe the API returns in correct order). Then concatenate the direction arrays into one departures array that is sent to the front application for rendering.

boghammar commented 7 years ago

Fixed today.