Skip to content

stats/bootstrap-timepicker-rails

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Bootstrap Timepicker for Rails

This is the gemified version of https://github.com/jdewit/bootstrap-timepicker

bootstrap-timepicker-rails project integrates Timepicker with Rails 3 assets pipeline.

Rails > 3.1

Include bootstrap-timepicker-rails in Gemfile;

gem 'bootstrap-timepicker-rails'

or you can install from latest build;

gem 'bootstrap-timepicker-rails', :require => 'bootstrap-timepicker-rails',
                              :git => 'git://github.com/tispratik/bootstrap-timepicker-rails.git'

and run bundle install.

Configuration

Add this line to app/assets/stylesheets/application.css

 *= require bootstrap-timepicker

Add this line to app/assets/javascripts/application.js

//= require bootstrap-timepicker

Using bootstrap-timepicker-rails

Just call timepicker() with any selector.

$('.timepicker').timepicker()

Callback for time picked.

$('.timepicker').timepicker()
    .on('changeTime', function(ev) {
      alert('time has changed');
      });

Set time via data-time attribute.

<div class='input-append bootstrap-timepicker-component' style='display: inline;'>
  <input class='dateselect-time input-small' type='text' data-time='12:45 PM'>
  <span class='add-on'><i class='icon-time'></i></span>
</div> 

About

bootstrap-timepicker-rails

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Ruby 100.0%