Setting the Step on a Formtastic DateTime picker

40 Views Asked by At

I have a date time picker in my active_admin/formtastic form, I dont want to be able to choose the seconds, just the date hours an minutes. How can I do that? The documentation says to set step, but this seems to be ignored.

fp.input :profiled_at,  as:  :datetime_picker, :step => :hour , :size => 16, input_html: { value: Time.now.to_s(:db)     }
1

There are 1 best solutions below

1
eugen On

If you're using the default datetime picker, try this syntax

fp.input :profiled_at, as: :datetime_picker, size: 16, input_html: {step: :hour, value: Time.now.to_s(:db)}