try to avoid ValueError because of erroneous date
This commit is contained in:
parent
c7059e4f52
commit
b988ec0f32
1 changed files with 4 additions and 1 deletions
|
@ -304,7 +304,10 @@ class DateFieldInstance(NumberFieldInstance):
|
|||
return ''
|
||||
if isinstance(value, basestring):
|
||||
return value
|
||||
return strftime('%Y-%m-%dT%H:%M', value.timetuple())
|
||||
try:
|
||||
return strftime('%Y-%m-%dT%H:%M', value.timetuple())
|
||||
except ValueError:
|
||||
return ''
|
||||
|
||||
def display(self, value):
|
||||
if value is None:
|
||||
|
|
Loading…
Add table
Reference in a new issue