diff --git a/src/gen/lib/date.py b/src/gen/lib/date.py index 8ea68b93c..564a0ef4b 100644 --- a/src/gen/lib/date.py +++ b/src/gen/lib/date.py @@ -111,6 +111,9 @@ class Span: return False return self.diff_tuple > other.diff_tuple + def __len__(self): + return len(self.diff_tuple) + #------------------------------------------------------------------------- # @@ -904,6 +907,12 @@ class Date: """ return self.modifier != Date.MOD_TEXTONLY + def is_valid(self): + """ + Return true if any part of the date is valid. + """ + return self.modifier != Date.MOD_TEXTONLY and self.sortval != 0 + def get_stop_year(self): """ Return the day of the year associated with the second part of a