From 457ea855d67fdc542c6e30188c4eb85c2b72553b Mon Sep 17 00:00:00 2001 From: Don Allingham Date: Thu, 17 May 2001 23:11:23 +0000 Subject: [PATCH] Added valid and empty checks svn: r26 --- src/Date.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/Date.py b/src/Date.py index 9f71c2414..26c370952 100644 --- a/src/Date.py +++ b/src/Date.py @@ -40,7 +40,6 @@ class Date: range = 1 normal = 0 - invalid = -1 from_str = _("(from|between|bet)") to_str = _("(and|to)") @@ -128,6 +127,18 @@ class Date: else: return self.start.getFmt3() + def isEmpty(self): + if self.start.year == -1 and self.start.month == -1 and self.start.day == -1: + return 1 + else: + return 0 + + def isValid(self): + if self.range == -1: + return 0 + else: + return 1 + #-------------------------------------------------------------------- # #