braincrafted / bootstrap-bundle

BraincraftedBootstrapBundle integrates Bootstrap into Symfony2 by providing templates, Twig extensions, services and commands.
http://bootstrap.braincrafted.com
MIT License
399 stars 184 forks source link

DateTime render #425

Closed fcpauldiaz closed 8 years ago

fcpauldiaz commented 8 years ago

I'm rendering a datetime field but it renders like this:

captura de pantalla 2016-02-07 16 56 29

They should be in the same row, how can I do that? And how can I change the format ?

This is my only config and I'm using the 2.2.0 version:

braincrafted_bootstrap:
    css_preprocessor: lessphp
    jquery_path: %kernel.root_dir%/../web/js/jquery-2.1.1.min.js

twig:
    debug:            "%kernel.debug%"
    strict_variables: "%kernel.debug%"
    form:
        resources: ['bootstrap_3_layout.html.twig']
florianeckerstorfer commented 8 years ago

It looks like you are using the Bootstrap layout provided by Symfony. Please refer to the Symfony docs or ask the Symfony community for help.

dkisselev commented 8 years ago

I think this is actually an issue introduced by recent versions of Bootstrap.

On our site, when we switched from braincrafted's assetic bootstrap build to just raw bs, we also had the same thing happen.

I'm guessing that the recommended twbs release in composer.json is older so it still has proper date field classes, but recent versions seem to have removed them (and I couldn't find any documentation on the matter..)

Using three fields for a date picker was a terrible solution anyway, so I opted to do this: http://ajaxray.com/blog/symfony2-forms-bootstrap-3-datepicker-for-date-field and it's worked really well for us.

fcpauldiaz commented 8 years ago

Thanks @dkisselev for the reply, I will look into this.

I solved this by using a form theme for only one form field like this:

   {% block _appbundle_curso_year %}
        <div class="form-inline">

             {{ form_row(form.year) }}
         </div>

    {% endblock %}