From 1ab265651724e3577bcf4b73c7e2d3c862ab1811 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Rapinat?= Date: Sat, 21 May 2011 08:38:22 +0000 Subject: [PATCH] 2521, 4923 'after' and validation (partial fix); typo on NextYear() svn: r17545 --- src/DateEdit.py | 2 +- src/gen/lib/date.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/DateEdit.py b/src/DateEdit.py index b2b9dd39a..fe89320f6 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 77f91e224..43ec315af 100644 --- a/src/gen/lib/date.py +++ b/src/gen/lib/date.py @@ -1749,7 +1749,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 #-------------------------------------------------------------------------