This gem packages the bootstrap-datetimepicker for the Rails 3.1+ asset pipeline.
Eonasdan's fork of tarruda's bootstrap-datetimepicker is actively maintained and works with Bootstrap3.
momentjs-rails is a required dependency.
Add these lines to your application's Gemfile:
gem 'momentjs-rails', '~> 2.5.0'
gem 'bootstrap3-datetimepicker-rails', '~> 3.0.0'
And then execute:
$ bundle
Or install it yourself:
$ gem install momentjs-rails
$ gem install bootstrap3-datetimepicker-rails
To start using the bootstrap-datetimepicker plugin in your rails application, enable it via the asset pipeline.
Add the following to your Javascript manifest file (application.js
):
//= require moment
//= require bootstrap-datetimepicker
If you want to include a localization, also add:
//= require moment/<locale>
//= require locales/bootstrap-datetimepicker.<locale>.js
Add the following to your stylesheet file:
If you are using SCSS, modify your application.css.scss
@import 'bootstrap';
@import 'bootstrap-datetimepicker';
If you're using just plain CSS, modify your application.css
*= require bootstrap
*= require bootstrap-datetimepicker
Check out the documentation at: http://eonasdan.github.io/bootstrap-datetimepicker/
- 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