7034 and 6965: missing method

svn: r23029
This commit is contained in:
Doug Blank 2013-09-04 10:40:27 +00:00
parent 3352bcd8b2
commit b4a0ce3702

View File

@ -1290,6 +1290,16 @@ class Date(object):
self.dateval = tuple(dv)
self._calc_sort_value()
def set2_yr_mon_day(self, year, month, day):
"""
Set the year, month, and day values.
"""
dv = list(self.dateval)
dv[Date._POS_RYR] = year
dv[Date._POS_RMON] = month
dv[Date._POS_RDAY] = day
self.dateval = tuple(dv)
def set_yr_mon_day_offset(self, year=0, month=0, day=0):
"""
Set the year, month, and day values by offset.
@ -1349,6 +1359,7 @@ class Date(object):
elif dv[Date._POS_RMON] > 12 or dv[Date._POS_RMON] < 1:
dv[Date._POS_RYR] += int(dv[Date._POS_RMON] / 12)
dv[Date._POS_RMON] = dv[Date._POS_RMON] % 12
self.dateval = tuple(dv)
if day != 0 or dv[Date._POS_RDAY] > 28:
self.set2_yr_mon_day(*self.offset(day))