Search code examples
jqueryhtmlcsstwitter-bootstrapdatetimepicker

Align the Bootstrap Datetimepicker so that it rests above the textbox instead of below


How do you align the Bootstrap Datetimepicker so that it rests above the textbox instead of below. My popup window is currently being cut out by another div.

enter image description here

Code

$(document).ready(function () {
    $('#datetime').datetimepicker({
        locale: 'en'
    });
});
<input type="text" class="form-control booking" id="datetime" placeholder="I want it now">

Fiddle here


Solution

  • The widgetPositioning option did the trick:

    $('#datetime').datetimepicker({
        locale: 'en',
        widgetPositioning: {
            vertical: 'top',
            horizontal: 'left'
        }
    });