Keep arrival trains during 5 minutes

This commit is contained in:
Emmy D'Anello 2024-02-10 22:22:17 +01:00
parent f50391970f
commit da82ef7950
Signed by: ynerant
GPG Key ID: 3A75C55819C8CF85
1 changed files with 1 additions and 0 deletions

View File

@ -229,6 +229,7 @@ class NextArrivalsViewSet(viewsets.ReadOnlyModelViewSet):
query_time = timedelta(seconds=int(query_time[:2]) * 3600 query_time = timedelta(seconds=int(query_time[:2]) * 3600
+ int(query_time[3:5]) * 60 + int(query_time[3:5]) * 60
+ (int(query_time[6:]) if len(query_time) > 6 else 0)) + (int(query_time[6:]) if len(query_time) > 6 else 0))
query_time -= timedelta(minutes=5) # Keep the last trains of the 5 previous minutes
yesterday = query_date - timedelta(days=1) yesterday = query_date - timedelta(days=1)
time_yesterday = query_time + timedelta(days=1) time_yesterday = query_time + timedelta(days=1)