heartcombo/simple_form-bootstrap

data-date-viewmode not working?

exocode opened this issue · 5 comments

Could it be, that:

data-date-viewmode="years"

does not work correctly?

You should be able to generate this attribute in you HTML code.

Is it being generated?

I do. It stays on the day viewmode and not on the viewmode years

rendered html

<div class="input-append date" id="user_birthday" data-date-viewmode="years" data-date-format="dd-mm-yyyy
    <input class="string required span2" id="user-birthday" name="user[birthday]" placeholder="dd-mm-yyyy" size="50" type="text" />
    <span class="add-on">
    <i style="color: grey;" class="icon-calendar"></i>
    </span>
</div>

code

<label for="user_birthday">Birthday</label>
<div class="input-append date" id="user_birthday" data-date-viewmode="years" data-date-format="dd-mm-yyyy">
    <%= f.input_field :birthday, id: "user-birthday", class: "span2", :placeholder => 'dd-mm-yyyy' %>
        <span class="add-on" >
            <i style="color: grey;" class="icon-calendar"></i>
    </span>
</div>
    <p class="help-block">Format must be dd-mm-yyyy</p>

sorry.. I pushed the wrong button... :-/

This is not related with SimpleFrom. Maybe is something in the Bootstrap project.

Issue can be viewed here:

Nerian/bootstrap-datepicker-rails#24