1,首先你要在你的页面上引用一个js
<script src="<?php echo URL::base() ?>media/vendor/datepicker/WdatePicker.js"></script>
2.时间输入框代码:
<div class="form-group fromgroup marginnone">
<input type="text" class="form-control" name="orders_export_time_from" placeholder="开始时间" value="" onfocus="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})">~
<input type="text" class="form-control" name="orders_export_time_to" placeholder="结束时间" value="" onfocus="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})">
</div>
<script type="application/javascript">
$(function () {
$('input[name="date"]').click(function(){
WdatePicker({dateFmt:'yyyy-MM',minDate:'2008-01',maxDate:'%y-%M'});
});
})
</script>