Commit d4d62fc8 authored by Jérome Perrin's avatar Jérome Perrin

quick and dirty hack to support 2 digit years in datetime fields again.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@18054 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 9ae6e4e7
......@@ -1163,7 +1163,17 @@ class PatchedDateTimeValidator(DateTimeValidator):
tmp_day = DateTime(tmp_year, tmp_month, 1, hour, minute)
result = tmp_day - 1
else:
result = DateTime('%s/%s/%s %s:%s %s' %(int(year), int(month), int(day), hour, minute, timezone))
result = DateTime(int(year),
int(month),
int(day),
hour,
minute)
year = result.year()
result = DateTime('%s/%s/%s %s:%s %s' % (year,
int(month),
int(day),
hour,
minute, timezone))
# ugh, a host of string based exceptions (not since Zope 2.7)
except ('DateTimeError', 'Invalid Date Components', 'TimeError',
DateError, TimeError) :
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment