2521, 4923 'after' and validation (partial fix); typo on NextYear()

svn: r17545
This commit is contained in:
Jérôme Rapinat 2011-05-21 08:38:22 +00:00
parent bf73874f6c
commit 1ab2656517
2 changed files with 2 additions and 2 deletions

View File

@ -150,7 +150,7 @@ class DateEdit(object):
# if text could not be parsed it is assumed invalid # if text could not be parsed it is assumed invalid
if self.date_obj.get_modifier() == Date.MOD_TEXTONLY: if self.date_obj.get_modifier() == Date.MOD_TEXTONLY:
return ValidationError(_('Bad Date')) return ValidationError(_('Bad Date'))
elif (self.date_obj.to_calendar(calendar_name=Date.CAL_GREGORIAN) > elif (self.date_obj.to_calendar(calendar_name=Date.CAL_GREGORIAN) >>
NextYear()): NextYear()):
return ValidationError(_('Date more than one year in the future')) return ValidationError(_('Date more than one year in the future'))

View File

@ -1749,7 +1749,7 @@ def NextYear():
import time import time
next_year = Date() next_year = Date()
thisyear = time.localtime(time.time()) thisyear = time.localtime(time.time())
next_year.set_yr_mon_day(thisyear[0]+1, thisyear[1], thisyear[3]) next_year.set_yr_mon_day(thisyear[0]+1, thisyear[1], thisyear[2])
return next_year return next_year
#------------------------------------------------------------------------- #-------------------------------------------------------------------------