From d87a529d088b2b5a3356a4a9d82af07de39873ca Mon Sep 17 00:00:00 2001 From: Paul Beckingham Date: Sun, 28 May 2017 09:43:37 -0400 Subject: [PATCH] data: Added better error when an attempt is made to track a future interval --- src/data.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/data.cpp b/src/data.cpp index f3e7daac..c07f4738 100644 --- a/src/data.cpp +++ b/src/data.cpp @@ -213,6 +213,9 @@ Interval getFilter (const CLI& cli) 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) throw std::string ("The end of a date range must be after the start.");