bootstrap datetimepicker installation

半世苍凉 提交于 2019-12-02 17:40:29

问题


I am using bootstrap datetimepicker version 3. Here datetimepicker de-faulty taking current date and time. But in next version this problem is resolved. So I will try to use Eonasdan bootstrap datetimepicker version v4. For that what are the js and css files I have include in my jsp page?


回答1:


Check manual installation guide here.

You must include:

  • jQuery
  • Moment.js
  • Bootstrap + collapse + transitions

So the files needed would be:

  • bootstrap.min.js
  • bootstrap.min.css
  • moment-with-locales.js
  • bootstrap-datetimepicker.css
  • bootstrap-datetimepicker.js

Check this fiddle for a working example.

HTML:

<br/>
<!-- padding for jsfiddle -->
<div class="row">
    <div class="col-md-12">
         <h6>datetimepicker1</h6>

        <div class="form-group">
            <div class="input-group date" id="datetimepicker1">
                <input type="text" class="form-control" />  <span class="input-group-addon"><span class="glyphicon-calendar glyphicon"></span></span>
            </div>
        </div>
    </div>
</div>

JS:

$('#datetimepicker1').datetimepicker();


来源:https://stackoverflow.com/questions/29001753/bootstrap-datetimepicker-installation

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