I am trying to use the jQuery UI datpicker for a form to create an event.
The rendering form itself is great, and if I use the usual rails date_field, the information is saved without any problems. However, when I try to use datepicker, it claims that the form cannot be empty, even if I selected the date. I understand that this is due to the difference in the date format used by rails and datepicker, so I tried the following code:
$(function(){
$("#dateField").datepicker({
dateFormat: "yyyy-mm-dd"
});
});
But that didn't seem to work. The date is still displayed in the default datepickers format and passes this format as a parameter, resulting in an error. Any pointers would be appreciated!
source
share