Bootstrap 3 datetimepicker widget position

匿名 (未验证) 提交于 2019-12-03 07:36:14

问题:

I am using bootstrap 3 diatomite picker widget, but I am unable to control its position. Right now the widget appears at the bottom of my page when I don't use horizontal and vertical options, but when I use horizontal and vertical options I get an error saying horizontal is not a valid option.

These options are not working for me:

horizontal: 'right',
vertical: 'top'

Here is my code:

enter code here <input type="text" value="<fmt:formatDate value="${visitDetail.visitDate }" pattern="dd-MM-yyyy hh:mm aaa" />" name="patient.visitDetails[${status.index}].visitDate" class="form-control" id="visitDate${status.index}" placeholder="visitDate${status.index}">    <script type="text/javascript">     $(function () {         $("#visitDate${status.index}").datetimepicker({             showTodayButton: true,             inline: false,             format: "DD-MM-YYYY hh:mm A",             sideBySide: true,             horizontal: 'right',             vertical: 'top'         });     }); </script> 

回答1:

$('.date').datetimepicker({     language: 'es',     format: 'dd/mm/yyyy',     autoclose: 1,     weekStart: 1,     startView: 2,     todayBtn: 1,     todayHighlight: 1,     forceParse: 0,     minView: 2,     pickerPosition: "top-left" }); 


回答2:

horizontal and vertical should be used as parameters of the widgetPositioning option. See http://jsfiddle.net/spasticdonkey/qmauopp0/3/

$(function () {     $('#datetimepicker1').datetimepicker({         showTodayButton: true,         format: "DD-MM-YYYY hh:mm A",         sideBySide: true,         widgetPositioning: {             horizontal: 'right',             vertical: 'top'         }     }); }); 


易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!