9

I'm tryin to change the orientation of the Bootstrap Datetimepicker I even tried with this but I get:

option orientation is not recognized

My definition of the datetimepicker in the html is:

<div class='input-group date datepicker' name="datepicker">
    <input type='text' class="form-control placementT" id="fecha">
         <span class="input-group-addon">
               <span class="glyphicon glyphicon-calendar">
               </span>
         </span>
</div>

In the javascript I have something like this to change the language:

$('.input-group.date').datetimepicker({
            locale: "es",
        });

I tried adding location:'bottom auto' but nothing happens.

ProgrammingDude
  • 597
  • 1
  • 5
  • 25
Sredny M Casanova
  • 4,735
  • 21
  • 70
  • 115
  • I don't understand what you are trying to do. What do you mean by "orientation"? If you use an [option](http://bootstrap-datepicker.readthedocs.org/en/latest/options.html) that's not supported then you should expect errors. – Jasen Dec 14 '15 at 18:48
  • @Jasen I want that the datepicker always open down the input, and never in the top of the input. by default the datetimepicker have _auto_ in that property and sometimes opens down or up. I want this always down – Sredny M Casanova Dec 14 '15 at 18:53
  • You could try to recompute its `top` and `left` in the `show()` event. You'll also have to adjust its `datepicker-orient-*` classes. But you might want to search for a different plug-in that will give you the option. – Jasen Dec 14 '15 at 19:04

1 Answers1

15

After reading a lot of post, and the documentation, I made it! for future visitors, can read all the available option here and for this specific example, I made:

 $('.input-group.date').datetimepicker({
            widgetPositioning:{
                                horizontal: 'auto',
                                vertical: 'bottom'
                            }
        });

Now, all the time I have the datetimepicker in the bottom of the input, and this is just what I wanted.

Sredny M Casanova
  • 4,735
  • 21
  • 70
  • 115