Bootstrap DateTimePicker关闭按钮位置

时间:2018-05-08 07:40:46

标签: eonasdan-datetimepicker

我在我的项目中使用Eonasdan Bootstrap-datetimepicker!有没有选项可以从上到下改变关闭按钮的位置? (不是小工具位置)。我在那里搜索文档,但我找不到它。

提前致谢

1 个答案:

答案 0 :(得分:0)

您必须使用toolbarPlacement选项。

  

默认值:'默认'

     

接受:'默认','顶部','底部'

$('#myDatepicker').datetimepicker({
  toolbarPlacement: 'bottom',
  showClose: true,
});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.18.1/moment.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-datetimepicker/4.17.47/js/bootstrap-datetimepicker.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet"/>
<link href="https://cdn.rawgit.com/Eonasdan/bootstrap-datetimepicker/25c11d79/build/css/bootstrap-datetimepicker.min.css" rel="stylesheet"/>


<br/>
<!--Space for the fiddle-->
<div class="container">
  <div class="row">
    <div class='col-sm-6'>
      <div class="form-group">
        <div class='input-group date' id='myDatepicker'>
          <input type='text' class="form-control" />
          <span class="input-group-addon">
                        <span class="glyphicon glyphicon-calendar"></span>
          </span>
        </div>
      </div>
    </div>
  </div>
</div>