Added len to Span class, and added an is_valid method to date. is_valid similar to is_regular, but allows partial dates
svn: r11528
This commit is contained in:
parent
e9bf31ef33
commit
323ac9257f
@ -111,6 +111,9 @@ class Span:
|
|||||||
return False
|
return False
|
||||||
return self.diff_tuple > other.diff_tuple
|
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
|
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):
|
def get_stop_year(self):
|
||||||
"""
|
"""
|
||||||
Return the day of the year associated with the second part of a
|
Return the day of the year associated with the second part of a
|
||||||
|
Loading…
Reference in New Issue
Block a user