File tree Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Original file line number Diff line number Diff line change @@ -54,6 +54,12 @@ export function sortAndFilterTrips (
54
54
// Sort by first arrival time. If they are the same, fall back on first
55
55
// departure time. Finally, sort by trip ID.
56
56
. sort ( ( a , b ) => {
57
+ if ( a . frequencies . length > 0 && b . frequencies . length > 0 ) {
58
+ // Sort frequency trips purely by start time. (Stop times are all
59
+ // the same for frequencies of the same pattern.) Generally, a trip
60
+ // only has one frequency entry (for now).
61
+ return a . frequencies [ 0 ] . startTime - b . frequencies [ 0 ] . startTime
62
+ }
57
63
// There may be a case where a null value (skipped stop) appears first
58
64
// in the list of stopTimes. In this case, we want to compare on the
59
65
// first stopTime that exists for each pair of trips.
You can’t perform that action at this time.
0 commit comments