eonasdan DateTimePicker autoclose doesn't work

自古美人都是妖i 提交于 2019-12-13 02:48:39

问题


If I removed the autoclose it works fine. How to autoclose datetimepicker. I've been searching on this but couldn't find useful information.

$('#start_schedule').datetimepicker({
        format: 'HH:mm',
        autoclose: true

    });

回答1:


It doesn't work actually according to documentation. If you will use showClose: true, it won't recognize, you will get an error. There is no other way rather than using this code in the docs. Hope this help.

<div class="container">
  <div class="row">
    <div class='col-sm-6'>
      <div class="form-group">
        <div class='input-group date' id='datetimepicker3'>
          <input type='text' class="form-control" />
          <span class="input-group-addon">
            <span class="glyphicon glyphicon-time"></span>
          </span>
        </div>
      </div>
    </div>
    <script type="text/javascript">
      $(function () {
        $('#datetimepicker3').datetimepicker({
          format: 'LT'
        });
      });
    </script>
  </div>
</div>


来源:https://stackoverflow.com/questions/28933819/eonasdan-datetimepicker-autoclose-doesnt-work

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