Add a bit more flexibility to jquery time input values
i.e. for when the user hand-keys a value
This commit is contained in:
		
							parent
							
								
									9f14d01c22
								
							
						
					
					
						commit
						42b97d1e1a
					
				
					 1 changed files with 8 additions and 1 deletions
				
			
		|  | @ -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') | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Lance Edgar
						Lance Edgar