# HG changeset patch # User teemu # Date 1499001296 -10800 # Node ID 0b53b7c70875198385ccc738cbf4044fc7d2251d # Parent 4354d459c231cec2c08c1098ce22d1ab17664849 Näytä myös aikataulut jotka ovat minuutti sitten menneet diff -r 4354d459c231 -r 0b53b7c70875 buses.py --- a/buses.py Wed Jun 28 17:52:42 2017 +0300 +++ b/buses.py Sun Jul 02 16:14:56 2017 +0300 @@ -112,7 +112,7 @@ if stop and (arrivals or not stop.is_arrival) and stop is not trip.schedule[-1]: # ja jos tämä halt on tulevaisuudessa, stop_time = datetime.combine(date, time()) + stop.arrival_time - if stop_time >= now(): + if stop_time + timedelta(minutes = 1) >= now(): # lisää halt listaan. result.append({ 'time': stop_time, diff -r 4354d459c231 -r 0b53b7c70875 service.py --- a/service.py Wed Jun 28 17:52:42 2017 +0300 +++ b/service.py Sun Jul 02 16:14:56 2017 +0300 @@ -107,7 +107,7 @@ def time_representation(time, relative = True): time_difference = time - now() - if relative and time_difference > timedelta(0) and time_difference < timedelta(minutes = 1): + if relative and timedelta(minutes = -1) < time_difference < timedelta(minutes = 1): return tr('right-now', 'misc-text') elif relative and time_difference > timedelta(0) and time_difference < timedelta(minutes = 10): return '%dm' % round(time_difference.seconds / 60)