Commit fff2c058 authored by Kevin Deldycke's avatar Kevin Deldycke

Better handling of no DateTime data for DateTime field;

Remove trailing spaces.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@3659 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent e5501f7a
......@@ -586,14 +586,13 @@ class PatchedDateTimeWidget(DateTimeWidget):
if value is None and field.get_value('default_now'):
value = DateTime()
if value is None:
year = None
month = None
day = None
hour = None
minute = None
ampm = None
else:
if value is type(DateTime()):
year = "%04d" % value.year()
month = "%02d" % value.month()
day = "%02d" % value.day()
......@@ -603,7 +602,6 @@ class PatchedDateTimeWidget(DateTimeWidget):
hour = "%02d" % value.hour()
minute = "%02d" % value.minute()
ampm = value.ampm()
input_order = field.get_value('input_order')
if input_order == 'ymd':
order = [('year', year),
......
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