A nice time plug-in bootstrap -bootstrap-datepicker

bootstrap bootstrap-datepicker is in an easy to use plug-in time, support Chinese, support the selection period, the time format configuration support, online examples of usage provide friendly.

Click on the configuration page, lower right corner of the code synchronized.

1. Download bootstrap-datepicker in on the bootstrap folder.

Be referenced in the page css

 <link rel="stylesheet" href="bootstrap-datepicker-1.9.0-dist/css/bootstrap-datepicker.min.css">

Js references js carried out later in the page, put the jquery and bootstrap

  <script src="bootstrap-datepicker-1.9.0-dist/js/bootstrap-datepicker.min.js"></script>
  <script src="bootstrap-datepicker-1.9.0-dist/locales/bootstrap-datepicker.zh-CN.min.js"></script>

2. Add the input elements on the page

<div id="sandbox-container">
    <input type="text" class="form-control">
</div>

3. Add the page js code

    $('#sandbox-container input').datepicker({
    language: "zh-CN",//配置中文
    autoclose: true,//自动关闭
    format: "yyyy-mm-dd"//日期显示格式
});

final effect

Guess you like

Origin www.cnblogs.com/ihappycat/p/11789238.html