diff --git a/tailbone/forms2/types.py b/tailbone/forms2/types.py index 2521adec..139aa784 100644 --- a/tailbone/forms2/types.py +++ b/tailbone/forms2/types.py @@ -37,4 +37,11 @@ class JQueryTime(colander.Time): def deserialize(self, node, cstruct): if not cstruct: return colander.null - return colander.timeparse(cstruct, '%I:%M %p') + try: + return colander.timeparse(cstruct, '%I:%M %p') + except ValueError: + try: + return colander.timeparse(cstruct, '%I:%M%p') + except: + # re-try first format, for "better" error + return colander.timeparse(cstruct, '%I:%M %p')