From 17897ff6700b130b8b085325ed8a80a9fa50bab3 Mon Sep 17 00:00:00 2001 From: Chris Moore Date: Tue, 17 May 2011 23:55:02 -0700 Subject: [PATCH] Don't allow the start date to be later than the end date. If it is, modify whichever we didn't just edit to match the one we did. --- pyfpdb/Filters.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/pyfpdb/Filters.py b/pyfpdb/Filters.py index 0eff8b69..0863a715 100644 --- a/pyfpdb/Filters.py +++ b/pyfpdb/Filters.py @@ -1198,6 +1198,18 @@ class Filters(threading.Thread): entry.set_text(ds) win.destroy() + # if the opposite date is set, and now the start date is later + # than the end date, modify the one we didn't just set to be + # the same as the one we did just set + if (entry == self.start_date): + end = self.end_date.get_text() + if (end and ds > end): + self.end_date.set_text(ds) + else: + start = self.start_date.get_text() + if (start and ds < start): + self.start_date.set_text(ds) + def main(argv=None): """main can also be called in the python interpreter, by supplying the command line as the argument.""" if argv is None: -- 2.11.4.GIT