理论可以看看:http://blog.csdn.net/u013372487/article/details/50534034
下载包:链接:http://pan.baidu.com/s/1kUNQ6bX 密码:d9kx
<script src="${ctx}/js/plugins/layer/laydate/laydate.js"></script>
<div class="col-sm-2" style=" 17.666667%;">
<input class="form-control layer-date laydate-icon required" style="float: left" placeholder="订单开始时间"
id="sub_start_time" name="sub_start_time">
</div>
<div class="col-sm-2" style=" 17.666667%;">
<input class="form-control layer-date laydate-icon required" id="sub_end_time" style="float: left" placeholder="订单结束时间"
name="sub_end_time">
</div>
对应的js文件中
$(function() { //开始时间 var sub_start_time = { elem: "#sub_start_time", format: "YYYY-MM-DD hh:mm:ss", max: "2099-06-16 23:59:59", istime: true, istoday: true, choose: function (datas) { sub_end_time.min = datas; $("#sub_start_time-error").remove(); $("#sub_start_time").removeClass("error"); } }; //开始时间 var sub_end_time = { elem: "#sub_end_time", format: "YYYY-MM-DD hh:mm:ss", max: "2099-06-16 23:59:59", istime: true, istoday: true, choose: function (datas) { $("#sub_end_time-error").remove(); $("#sub_end_time").removeClass("error"); } }; laydate(sub_start_time); laydate(sub_end_time); });