Remove usage of colander.timeparse()
function
that did very little, and has been removed in latest colander release
This commit is contained in:
parent
d2629e8925
commit
caec354092
|
@ -56,12 +56,12 @@ class JQueryTime(colander.Time):
|
|||
]
|
||||
for fmt in formats:
|
||||
try:
|
||||
return colander.timeparse(cstruct, fmt)
|
||||
return datetime.datetime.strptime(cstruct, fmt).time()
|
||||
except ValueError:
|
||||
pass
|
||||
|
||||
# re-try first format, for "better" error message
|
||||
return colander.timeparse(cstruct, formats[0])
|
||||
return datetime.datetime.strptime(cstruct, formats[0]).time()
|
||||
|
||||
|
||||
class DateTimeBoolean(colander.Boolean):
|
||||
|
|
Loading…
Reference in a new issue