<commit_before>## SimpleForm & Bootstrap DateTimepicker for Rails

This gem packages the bootstrap-datetimepicker for Rails asset pipeline, and creates the Simple Form custom fields for your project

The project home page: https://github.com/zpaulovics/datetimepicker-rails.git

The project is based on: https://github.com/tarruda/bootstrap-datetimepicker.git project as a git submodule


### Features

    - Setup the vendor directory (javascripts, stylesheets)
    - Intall the custom fields for Simple Form


### Installation

Add this line to your application's Gemfile:

    gem 'datetimepicker-rails' (Not yet released, use the master branch on git)

Or install it yourself from the latest build as:

    gem 'datetimepicker-rails', :require => 'datetimepicker-rails', :git => 'git://github.com/zpaulovics/datetimepicker-rails.git'

And then execute:

    $ bundle install

### Configuration

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

``` css
 *= require bootstrap-datetimepicker
```

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

``` javascript
//= require bootstrap-datetimepicker
```

You can fine tune the included files to suit your needs.

```javascript
//= require bootstrap-datetimepicker/core
//= require bootstrap-datetimepicker/pickers
//= require bootstrap-datetimepicker/locales/bootstrap-datetimepicker.hu.js
```

### Calling the generator

After you install datetimepicker and add it to your Gemfile, you need to run the generator:

    $ rails generate datetimepicker:install


### Using datetimepicker-rails

Just call datetimepicker() with any selector.

#### HTML

```html
<input class="datetimepicker" type="text" >

<script type="text/javascript">
    $('.datetimepicker').datetimepicker({
        format: 'yyyy/MM/dd hh:mm',
        language: 'hu',
        autoclose: true
    });
</script>
```

#### Simple_Form

```html
<%= f.input :start_date_time, :as => :datetime_picker %>

<%= f.input :begin-at, :as => :time_picker %>

<%= f.input :closing_date, :as => :date_picker %>
```


The above scripts will be included by require bootstrap-datetimepicker/pickers accordingly

```javascript
<script type="text/javascript">
    $('.datetimepicker').datetimepicker({
        format: 'yyyy/MM/dd hh:mm',
        language: 'hu',
        autoclose: true
    });

    $('.timepicker').datetimepicker({
        format: 'hh:mm',
        language: 'hu',
        pickDate: false,
        autoclose: true
    });

    $('.datepicker').datetimepicker({
        format: 'yyyy/MM/dd',
        language: 'hu',
        pickTime: false,
        autoclose: true
    });

</script>
```

### For more datails of usage

See the excellent demo provided by plugin's author - [@tarruda](https://github.com/tarruda) [here](http://tarruda.github.com/bootstrap-datetimepicker/).


### Contributing

1. Fork it
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'Add some feature'`)
4. Push to the branch (`git push origin my-new-feature`)
5. Create new Pull Request<commit_msg>Corrected the readme file<commit_after>## SimpleForm & Bootstrap DateTimepicker for Rails

This gem packages the bootstrap-datetimepicker for Rails asset pipeline, and creates the Simple Form custom fields for your project

The project home page: https://github.com/zpaulovics/datetimepicker-rails.git

The project is based on: https://github.com/tarruda/bootstrap-datetimepicker.git project as a git submodule


### Features

    - Setup the vendor directory (javascripts, stylesheets)
    - Intall the custom fields for Simple Form


### Installation

Add this line to your application's Gemfile:

    gem 'datetimepicker-rails' (Not yet released, use the master branch on git)

Or install it yourself from the latest build as:

    gem 'datetimepicker-rails', :require => 'datetimepicker-rails', :git => 'git://github.com/zpaulovics/datetimepicker-rails.git'

And then execute:

    $ bundle install

### Configuration

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

``` css
 *= require bootstrap-datetimepicker
```

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

``` javascript
//= require bootstrap-datetimepicker
```

You can fine tune the included files to suit your needs.

```javascript
//= require bootstrap-datetimepicker/core
//= require bootstrap-datetimepicker/pickers
//= require bootstrap-datetimepicker/locales/bootstrap-datetimepicker.hu.js
```

### Calling the generator

After you install datetimepicker and add it to your Gemfile, you need to run the generator:

    $ rails generate datetimepicker:install


### Using datetimepicker-rails

Just call datetimepicker() with any selector.

#### HTML

```html
<input class="datetimepicker" type="text" >

<script type="text/javascript">
    $('.datetimepicker').datetimepicker({
        format: 'yyyy/MM/dd hh:mm',
        language: 'hu',
        autoclose: true
    });
</script>
```

#### Simple_Form

```html
<%= f.input :start_date_time, :as => :datetime_picker %>

<%= f.input :begin-at, :as => :time_picker %>

<%= f.input :closing_date, :as => :date_picker %>
```


The scripts below will be included by require bootstrap-datetimepicker/pickers accordingly

```javascript
<   $('.datetimepicker').datetimepicker({
        format: 'yyyy/MM/dd hh:mm',
        language: 'hu',
        autoclose: true
    });

    $('.timepicker').datetimepicker({
        format: 'hh:mm',
        language: 'hu',
        pickDate: false,
        autoclose: true
    });

    $('.datepicker').datetimepicker({
        format: 'yyyy/MM/dd',
        language: 'hu',
        pickTime: false,
        autoclose: true
    });
```

### For more datails of usage

See the excellent demo provided by plugin's author - [@tarruda](https://github.com/tarruda) [here](http://tarruda.github.com/bootstrap-datetimepicker/).


### Contributing

1. Fork it
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'Add some feature'`)
4. Push to the branch (`git push origin my-new-feature`)
5. Create new Pull Request
{'fraction_non_alphanumeric': 0.12567856555354498, 'fraction_numerical': 0.0016450074025333114, 'mean_word_length': 3.7315175097276265, 'pattern_counts': {'":': 0, '<': 18, '<?xml version=': 0, '>': 27, 'https://': 6, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4949294', 'n_tokens_mistral': 1838, 'n_tokens_neox': 1702, 'n_words': 561}