The plugin is working however I am getting 'Uncaught TypeError: Cannot read property 'top' of undefined'
I am using the latest version.
<div class="form-group">
<div class="input-group date js-datetimepicker">
<input type="text" class="form-control">
</div>
</div>
$('.js-datetimepicker').datetimepicker({
allowInputToggle: true,
format:"MM/YYYY"
});
After inspecting the error it seems to be an issue with this line
if (offset.top + widget.height() * 1.5 >= $(window).height() + $(window).scrollTop() &&
I've been running into the same issue. A quick fix seems to be to replace:
var position = (component || element).position(),
offset = (component || element).offset(),
with:
var position = element.position(),
offset = element.offset(),
on line 378 - 379. Not sure if it has any adverse effects, I haven't noticed any yet.
Hi, If anyone still gets this
on the OP he has this:
<div class="form-group">
<div class="input-group date js-datetimepicker">
<input type="text" class="form-control">
</div>
</div>
If changed to this no error appear, this should be the guidelines of http://eonasdan.github.io/bootstrap-datetimepicker/#no-icon-input-field-only
<div class="form-group">
<div class="input-group date ">
<input type="text" class="form-control js-datetimepicker">
</div>
</div>
This is how I got it to work. The input element has to be wrapped with a div with position: relative
<div style="position: relative">
<input class="form-control" type="text" data-datetimepicker>
</div>
Most helpful comment
I've been running into the same issue. A quick fix seems to be to replace:
with:
on line 378 - 379. Not sure if it has any adverse effects, I haven't noticed any yet.