I’m making a simple scheduling app. I’m trying out simple_form, and I’ve got a JQuery Datepicker implemented, which returns a date like 04/30/2012.
#_form.html.erb
<%= simple_form_for @workout, :html => { :class => 'form-horizontal' } do |f| %>
<%= f.input :name %>
<%= f.input :date, :as => :date_picker%>
<%= f.input :time %>
<%= f.button :submit %>
<%= link_to t('.cancel', :default => t("helpers.links.cancel")),
workouts_path %>
<% end %>
#application.js
$("input.date_picker").datepicker();
The problem is that this date is being taken as DD/MM/YYYY instead of MM/DD/YYYY. I’d like to keep the original format, since that keeps things more natural, but I haven’t been able to figure out how to accept the desired date format.
I believe you are looking for the formateDate method.