diff --git a/src/DateEdit.py b/src/DateEdit.py index d964530e4..80c196c2a 100644 --- a/src/DateEdit.py +++ b/src/DateEdit.py @@ -150,7 +150,7 @@ class DateEdit(object): # if text could not be parsed it is assumed invalid if self.date_obj.get_modifier() == Date.MOD_TEXTONLY: 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()): return ValidationError(_('Date more than one year in the future')) diff --git a/src/gen/lib/date.py b/src/gen/lib/date.py index f04d22585..a142d4008 100644 --- a/src/gen/lib/date.py +++ b/src/gen/lib/date.py @@ -1709,7 +1709,7 @@ def NextYear(): import time next_year = Date() 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 #-------------------------------------------------------------------------