Nerian / bootstrap-datepicker-rails

A Datepicker for Twitter Bootstrap, integrated with Rails assets pipeline
MIT License
649 stars 182 forks source link

Gotchas should be in readme #119

Closed garthgoldwater closed 8 years ago

garthgoldwater commented 8 years ago

Since this is a wrapper for a non-rails-specific input, it might be a good idea to put some gotchas in the readme. The three I'm thinking of are

Would probably reduce the number of duplicate issues you see on this project and questions on stackoverflow.

jonjburgess commented 8 years ago

you can actually just add.... data-date-format="yyyy-mm-dd" to the html input to format correctly and save the date without additional gems.

<input type="text" data-provide='datepicker' data-date-format='yyyy-mm-dd'>
amycommits commented 8 years ago

For Rails4 in the form_for format this worked:

<%= f.text_field :started_on, "data-provide" => 'datepicker', 'data-date-format' => 'yyyy-mm-dd' %>

tomekr commented 7 years ago

@duaimei how would you go about adding the nested span and glyphicon so that the text_field helper generates:

<div class="input-group date">
  <input type="text" class="form-control"><span class="input-group-addon"><i class="glyphicon glyphicon-th"></i></span>
</div>