Bootstrap-datepicker 用法
<div class="input-group input-daterange"> <input type="text" id="sDate" name="sDate" readonly class="form-control" placeholder="开始日期"> <span class="input-group-addon">至</span> <input type="text" id="eDate" name="eDate" readonly class="form-control" placeholder="结束日期"> </div>
$("#sDate, #eDate").datepicker({ format: 'yyyy-mm-dd', weekStart: 1, autoclose: true, language: 'zh-CN', clearBtn: true }).on("changeDate", function (ev) {
//设置关联日期的开始日期和结束日期 var $t = $(this); if ($t.attr("name") == "sDate") { $eDate.datepicker("setStartDate", $t.val()); } else { $sDate.datepicker("setEndDate", $t.val()); } });