Skip to content
This repository was archived by the owner on Jun 29, 2023. It is now read-only.

Commit dba408d

Browse files
author
TiborAdk
committed
preventing underflow when 'departureTime' is in the past
1 parent a7ac0d0 commit dba408d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

mvg_api/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -335,7 +335,7 @@ def get_departures(station_id):
335335
delay = departure['delay']
336336
else:
337337
delay = 0
338-
departure[u'departureTimeMinutes'] = relative_time.seconds // 60 + delay
338+
departure[u'departureTimeMinutes'] = relative_time // datetime.timedelta(seconds=60) + delay
339339
return departures
340340

341341

0 commit comments

Comments
 (0)