data: Added better error when an attempt is made to track a future interval

This commit is contained in:
Paul Beckingham 2017-05-28 09:43:37 -04:00
parent 60ce6cef25
commit d87a529d08

View file

@ -213,6 +213,9 @@ Interval getFilter (const CLI& cli)
throw std::string ("Unrecognized date range: '") + join (" ", args) + "'."; throw std::string ("Unrecognized date range: '") + join (" ", args) + "'.";
} }
if (filter.range.start > now)
throw std::string ("Time tracking cannot be set in the future.");
if (filter.range.start > filter.range.end) if (filter.range.start > filter.range.end)
throw std::string ("The end of a date range must be after the start."); throw std::string ("The end of a date range must be after the start.");