All threads / How do I add a default time of 6:45pm to simple form / DatePicker

Ask A Question

Notifications

You’re not receiving notifications from this thread.

How do I add a default time of 6:45pm to simple form / DatePicker

Neil Patel asked in Rails

Hello

Folllowing on from the prev 2 posts , How do i add the default time of 645pm in the form. So when someone craates the form a default time of 645 is already setup. I am using simple form and datepicker.

At the moment I have this code which gives the current time and date (date is ok but want to change time to 645)

had a look at stackoveflow , simple form gem and datepicker but cannot resolve

i was thinking of using something like default: '645'

= f.input :started_at, as: :string, class: 'form-control', input_html: { value: l(@happening.started_at, format: :date_time_picker), class: 'date_time_picker' }, label: "Start at"

would also like to know rails 5 bootstrapv4 simple_form datetimepicker solution..

Join the discussion

Want to stay up-to-date with Ruby on Rails?

Join 34,674+ developers who get early access to new tutorials, screencasts, articles, and more.

    We care about the protection of your data. Read our Privacy Policy.

    logo Created with Sketch.

    Ruby on Rails tutorials, guides, and screencasts for web developers learning Ruby, Rails, Javascript, Turbolinks, Stimulus.js, Vue.js, and more. Icons by Icons8

    © 2020 GoRails, LLC. All rights reserved.