further fixes for slash dates and updates to unit tests

svn: r10588
This commit is contained in:
Doug Blank
2008-04-19 04:51:12 +00:00
parent 3373062274
commit 465e950888
3 changed files with 17 additions and 21 deletions

View File

@@ -87,7 +87,9 @@ class Span:
def __int__(self):
return int(self.diff_tuple[0] * 12 + self.diff_tuple[1]) # months
def __eq__(self, other):
return self.diff_tuple == other.diff_tuple
#-------------------------------------------------------------------------
#
@@ -511,14 +513,14 @@ class Date:
comparison >> :
Returns True if all parts of other_date > all parts of self
"""
if (self.sortval == 0 or other_date.sortval == 0):
return False
elif (other_date.modifier == Date.MOD_TEXTONLY or
if (other_date.modifier == Date.MOD_TEXTONLY or
self.modifier == Date.MOD_TEXTONLY):
if comparison in ["=", "=="]:
return (self.text.upper().find(other_date.text.upper()) != -1)
else:
return False
if (self.sortval == 0 or other_date.sortval == 0):
return False
# Obtain minimal start and maximal stop in Gregorian calendar
other_start, other_stop = other_date.get_start_stop_range()