Fix #91 bug with HSL timetable sorting

This commit is contained in:
Juhana Luomanen
2017-10-31 22:34:39 +02:00
parent 4ba830217e
commit e63f8d5418
2 changed files with 3 additions and 2 deletions
+2 -1
View File
@@ -47,7 +47,7 @@ def fetch():
route = place['pattern']['route']['shortName']
stop_times = place['_stoptimes']
for stop_time in stop_times:
timestamp = stop_time['serviceDay'] + stop_time['realtimeArrival']
timestamp = time_utc = stop_time['serviceDay'] + stop_time['realtimeArrival']
headsign = stop_time['stopHeadsign']
stop_name = stop_time['stop']['name']
time_diff = (timestamp - timezone.now().timestamp()) / 60 # minutes
@@ -64,6 +64,7 @@ def fetch():
'headsign': headsign,
'timestamp': time,
'stop': stop_name,
'utc': time_utc,
})
return schedule
+1 -1
View File
@@ -25,7 +25,7 @@
</tr>
</thead>
<tbody>
<tr class="repeat-item" ng-repeat="x in stoptimes | orderBy: ['timestamp'] | limitTo: 11">
<tr class="repeat-item" ng-repeat="x in stoptimes | orderBy: ['utc'] | limitTo: 11">
<td style="min-width: 300px">
{{x.timestamp}}
</td>