ruby on rails - Bootstrap datepicker default value simple_form_for -
i using bootstrap date picker enable selection of dates in form using simple_form_for. example
<%= f.input :payment_date, as: :string, input_html: { class: "datepicker" } %>
my date picker uses format of dd-mm-yyyy
i set today's date default value in form using simple_form_for, ideas on how can that?
<%= f.input :payment_date, as: :string, input_html: { class: "datepicker", value: time.now.strftime('%d-%m-%y') } %>
another format is: (working active admin gem)
f.input :date, as: :date_picker, :input_html => { :value => date.today}
Comments
Post a Comment