1
0
Fork 0

predict_windows: Improve start_date handling

This commit adds parsing of the start_date at the same place where the
end_date is already parsed.
environments/stage/deployments/265
Fabian P. Schmidt 2018-12-15 23:29:59 +01:00 committed by Pierros Papadeas
parent 558eb432fe
commit d2bca1fc38
1 changed files with 2 additions and 1 deletions

View File

@ -553,6 +553,7 @@ def prediction_windows(request, sat_id, transmitter, start_date, end_date,
}
return JsonResponse(data, safe=False)
start_date = make_aware(datetime.strptime(start_date, '%Y-%m-%d %H:%M'), utc)
end_date = make_aware(datetime.strptime(end_date, '%Y-%m-%d %H:%M'), utc)
# Initialize pyehem Satellite for propagation
@ -586,7 +587,7 @@ def prediction_windows(request, sat_id, transmitter, start_date, end_date,
observer.lon = str(station.lng)
observer.lat = str(station.lat)
observer.elevation = station.alt
observer.date = str(start_date)
observer.date = ephem.Date(start_date)
station_windows = []
while True: