From da82ef7950d707a426a5e98c228f9680820fe3df Mon Sep 17 00:00:00 2001 From: Emmy D'Anello Date: Sat, 10 Feb 2024 22:22:17 +0100 Subject: [PATCH] Keep arrival trains during 5 minutes --- sncf/api/views.py | 1 + 1 file changed, 1 insertion(+) diff --git a/sncf/api/views.py b/sncf/api/views.py index 45c4bb4..2001b81 100644 --- a/sncf/api/views.py +++ b/sncf/api/views.py @@ -229,6 +229,7 @@ class NextArrivalsViewSet(viewsets.ReadOnlyModelViewSet): query_time = timedelta(seconds=int(query_time[:2]) * 3600 + int(query_time[3:5]) * 60 + (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) time_yesterday = query_time + timedelta(days=1)