I’m trying to use the best_in_place gem with type => date , but I’m having some problems with the format. My rails date format is as follows:
Time::DATE_FORMATS.merge!({:default => '%d %b (%a)'})
Date::DATE_FORMATS.merge!({:default => '%d %b (%a)'})
And in my view I have:
<%= best_in_place @group, :appearance_time ,:type => :date %>
Now when the page is loaded the first time, the date is in the rails format, however when I change it with jquery, it goes back to the format “dd/mm/yy” .. I tried changing the format like this:
jQuery ->
$.extend($.fn.datepicker.defaults, { format: 'dd M D' });
But it doesn’t change anything.. How can I set the jquery date format?
Thank you,
Ok I figured it out in case anyone else has the same problem.
Jquery:
It needs to be called before your code.