0.0
No commit activity in last 3 years
No release in over 3 years
Wrapper for simple form to support a timepicker
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.14
~> 10.0
~> 3.0

Runtime

 Project Readme

TimeWrapper

Time wrapper is a simple form integration of gem bootstrap3-datetimepicker-rails. With a simple form wrapper :time.

Installation

Add this line to your application's Gemfile:

gem 'time_wrapper'

And then execute:

$ bundle

Or install it yourself as:

$ gem install time_wrapper

Setup dependencies

  • bootstrap
  • momentjs-rails
  • font-awesome-rails
  • simple_form

In application.scss

@import 'time_wrapper';

This will @import 'bootstrap-datetimepicker'; for you.

In application.js

//= require time_wrapper

This will //= require bootstrap-datetimepicker for you.

Usage

Given a datetime field named time use the following in simple form:

<%= f.input :time, as: :string, wrapper: :time %>

To get proper setter and getters, as well as basic format validation (you probably want to add your own) use the following in you model:

time_attribute :time

Generate stylesheets

If you want to customize the stylesheets.

$ rails g time_wrapper:stylesheets

Generate javascripts

If you want to customize the javascripts.

$ rails g time_wrapper:javascripts