js部部分
jeDate('#startTime', {format: 'YYYY-MM-DD',minDate: '1971-01-01', //设定最小日期onClose: false,isinitVal: true,maxDate: function (that) {//that 指向实例对象 var nowMaxDate = "" ? jeDate.nowDate({DD: 0 }) : $('#endTime').val();return nowMaxDate}, //设定最大日期为当前日期donefun: function (obj) {jeDate("#endTime", LinkageEndDate(false));}});jeDate('#endTime', LinkageEndDate);function LinkageEndDate(istg) {return {trigger: istg || "click",format: 'YYYY-MM-DD',onClose: false,isinitVal: true,minDate: function (that) {var nowMinDate = "" ? jeDate.nowDate({DD: 0 }) : $('#startTime').val();return nowMinDate;}, //设定最小日期为当前日期maxDate: jeDate.nowDate({DD: 0 }), //设定最大日期为当前日期};}
界面部分
<div class="pull-left input-w iptmr"><span class="des pull-left">检查时间:</span><div class="jeDateWrap pull-left input"><input class="" id="startTime" readonly="readonly" value="@DateTimeHelper.GetMonthRange().StartTime.ToString("yyyy-MM-dd")" /><i class="icon-calendar"></i></div><span class="pull-left time-seprate">-</span><div class="jeDateWrap pull-left input"><input class="" id="endTime" readonly="readonly" value="@DateTime.Now.ToString("yyyy-MM-dd")" /><i class="icon-calendar"></i></div></div>
效果