1. 程式人生 > >bootstrap-datetimepicker時間控件

bootstrap-datetimepicker時間控件

clas styles http 以及 str pro bootstrap ava format

官網:

http://www.bootcss.com/p/bootstrap-datetimepicker/index.htm

引用的js以及css:

<link rel="stylesheet" type="text/css" href="/static/css/bootstrap-datetimepicker.min.css">
<script type="text/javascript" src="/static/js/bootstrap-datetimepicker.fr.js"></script>
<script type="text/javascript
" src="/static/js/bootstrap-datetimepicker.min.js"></script> <script type="text/javascript" src="/static/js/bootstrap-datetimepicker.zh-CN.js"></script>

顯示插件的dom元素

   <div class="martb5">
          <label>
             <input type="radio" name="pro[STATUS]" value="
2"<?php if($proArr[base][PRO_STATUS] == 2) echo checked;?>/>指定時間</label> <input size="16" class="form-control" type="text" value="<?php echo date(‘Y-m-d H:i:s‘,time());?>" readonly id="form_datetime"> </div>

實例化:

<script type="text/javascript
"> $("#form_datetime").datetimepicker({ format: yyyy-mm-dd hh:ii, startDate:"<?php echo date(‘Y-m-d H:i:s‘,time());?>", todayHighlight:true, language:zh-CN, autoclose:true }); </script>

bootstrap-datetimepicker時間控件