activeadmin-plugins / active_admin_datetimepicker

:calendar: active_admin_datetimepicker gem
MIT License
72 stars 48 forks source link

how to set min date of end date from start date? #11

Closed spurdow closed 8 years ago

spurdow commented 8 years ago

If i have a form with start and end date how do i set the min of end_date using start_date value

how to set min date of end date using start_date value?

thanks

Fivell commented 8 years ago

@spurdow , README already contains example

form do |f|
  f.input :starts_at, as: :date_time_picker, datepicker_options: { min_date: "2013-10-8",        max_date: "+3D" }
  f.input :ends_at,   as: :date_time_picker, datepicker_options: { min_date: 3.days.ago.to_date, max_date: "+1W +5D" }
end

More options here http://xdsoft.net/jqplugins/datetimepicker/