elclanrs / jq-idealforms-old

The ultimate framework for building and validating responsive HTML5 forms.
665 stars 95 forks source link

DateTIMEpicker, datepicker starts on 1970 #148

Open Nickinfinity opened 11 years ago

Nickinfinity commented 11 years ago

I'm Trying use a timepicker to choose date and hour in mysql timestamp format: yyyy-mm-dd 00:00:00, use datepicker form jqideal forms and add manualy the time...

using a custom filter: timestamp: { regex: '/^(((\d{4})(-)(0[13578]|10|12)(-)(0[1-9]|[12][0-9]|3[01]))|((\d{4})(-)(0[469]|1‌​1)(-)([0][1-9]|[12][0-9]|30))|((\d{4})(-)(02)(-)(0[1-9]|1[0-9]|2[0-8]))|(([02468]‌​[048]00)(-)(02)(-)(29))|(([13579][26]00)(-)(02)(-)(29))|(([0-9][0-9][0][48])(-)(0‌​2)(-)(29))|(([0-9][0-9][2468][048])(-)(02)(-)(29))|(([0-9][0-9][13579][26])(-)(02‌​)(-)(29)))(\s([0-1][0-9]|2[0-4]):([0-5][0-9]):([0-5][0-9]))$/', error: 'My custom error' }

and filters: 'required timestamp', data: { date: 'yyyy-mm-dd 00:00:00' } // or yyyy~dd~mm or mm*yyyy*dd }

but on blur or focus out on the field with the dateTIME it changes the format yyyy-mm-dd 00:00:00 deleting time/hour = yyyy-mm-dd what should I do?

AND... datepicker starts on 1970 how I set it on 'today' as defalut?

Thank you for your help and sorry for bad english I hope you will can understand me.