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

Popular posts from this blog

Perl - how to grep a block of text from a file -

delphi - How to remove all the grips on a coolbar if I have several coolbands? -

javascript - Animating array of divs; only the final element is modified -