Added a small snippet to give users a descent error message,
when their start date is afer the stop date. Also updated the tests.
This commit is contained in:
@@ -103,5 +103,7 @@ class TimeRange:
|
||||
stop = int(stops) // 1000
|
||||
else:
|
||||
stop = int(stops)
|
||||
if start > stop > 0:
|
||||
raise Exception('Start date is after stop date for timerange "%s"' % text)
|
||||
return TimeRange(stype[0], stype[1], start, stop)
|
||||
raise Exception('Incorrect syntax for timerange "%s"' % text)
|
||||
|
Reference in New Issue
Block a user