Adds a custom input picktastic_date_picker and supplies a js file that will bind the jquery datepicker widget to these inputs,
Add this line to your application's Gemfile:
gem 'picktastic'
And then execute:
$ bundle
Or install it yourself as:
$ gem install picktastic
Add the following file to your javascripts that are loaded on every page, i.e. app/assets/javascripts/application.js
//= require picktastic/onload
To create a date input field use the following builder
= f.input :starts_at, as: :picktastic_date_picker
To force a different date format for the datepicker create an initializer (i.e. config/initializers/datepicker.rb
) where you set a format string in the jquery format:
PicktasticDatePickerInput::format = 'dd.mm.yy'
- Fork it
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request