Merge changes made between 2.0.3 and 2.0.5
svn: r4911
This commit is contained in:
11
src/Date.py
11
src/Date.py
@@ -156,12 +156,12 @@ class Date:
|
||||
instance IN ALL REGARDS. Needed, because the __cmp__ only looks
|
||||
at the sorting value, and ignores the modifiers/comments.
|
||||
"""
|
||||
|
||||
if self.modifier == other.modifier and self.modifier == MOD_TEXTONLY:
|
||||
return self.text == other.text
|
||||
return (self.calendar == other.calendar and
|
||||
self.modifier == other.modifier and
|
||||
self.quality == other.quality and
|
||||
self.dateval == other.dateval and
|
||||
self.text == other.text and
|
||||
self.sortval == other.sortval)
|
||||
|
||||
def __str__(self):
|
||||
@@ -340,6 +340,7 @@ class Date:
|
||||
"""
|
||||
"""
|
||||
self.dateval = self.dateval[0:2] + (year,) + self.dateval[3:]
|
||||
self.calc_sort_value()
|
||||
|
||||
def get_year_valid(self):
|
||||
return self._get_low_item_valid(_POS_YR)
|
||||
@@ -458,6 +459,12 @@ class Date:
|
||||
if text:
|
||||
self.text = text
|
||||
|
||||
def calc_sort_value(self):
|
||||
year = max(self.dateval[_POS_YR],1)
|
||||
month = max(self.dateval[_POS_MON],1)
|
||||
day = max(self.dateval[_POS_DAY],1)
|
||||
self.sortval = _calendar_convert[self.calendar](year,month,day)
|
||||
|
||||
def convert_calendar(self,calendar):
|
||||
"""
|
||||
Converts the date from the current calendar to the specified
|
||||
|
Reference in New Issue
Block a user