PDA

View Full Version : timefield stops converting 900 to 09:00 after 1259



Datamex
6 Mar 2015, 3:03 AM
I've added several timefields to a form and when typing in times like 900, 1200 etc. the time is being converted to 09:00 and 12:00 as it should be. When I enter a time after 1259, 1300 for instance, then this behavior doesn't work anymore. Is there a way I can solve this?

I've created a fiddle http://jsfiddle.net/Guido_Neele/a6u5sno3/1/

yeghikyan
6 Mar 2015, 5:08 AM
set the following property to your time fields:



altFormat: 'g:ia|g:iA|g:i a|g:i A|h:i|g:i|H:i|ga|ha|gA|h a|g a|g A|hi|gia|hia|g|H|gi a|hi a|giA|hiA|gi A|hi A|gi'

Datamex
9 Mar 2015, 4:32 AM
set the following property to your time fields:



altFormat: 'g:ia|g:iA|g:i a|g:i A|h:i|g:i|H:i|ga|ha|gA|h a|g a|g A|hi|gia|hia|g|H|gi a|hi a|giA|hiA|gi A|hi A|gi'


You've pointed me in the right direction. Only thing I had to add was Gi|Hi|, so the final result looked like this:



altFormat: 'g:ia|g:iA|g:i a|g:i A|h:i|g:i|H:i|Gi|Hi|ga|ha|gA|h a|g a|g A|hi|gia|hia|g|H|gi a|hi a|giA|hiA|gi A|hi A|gi'