<div style="margin:20px 0px 20px 70px">
<span>有效期起始时间:</span><input id='expireStartTimeUp'data-options="required:true" name="expireStartTime" class='easyui-datebox'>
<br>
<br>
<span>有效期结束时间:</span><input id='expireEndTimeUp' data-options="required:true,validType:'equalDate[\'#expireStartTimeUp\']'" name="expireEndTime" class='easyui-datebox'>
</div>
$.extend($.fn.validatebox.defaults.rules,{
equalDate:{
validator :function (value,param) {
var start = $(param[0]).datetimebox('getValue');
return value >=start;
},
message:"结束时间不能小于起始时间"
},
compareTime:{
validator :function (value,param) {
var start = $('#expireStartTimeUp').timespinner('getValue');
var end = $('#expireEndTimeUp').timespinner('getValue');
return end >=start;
},
message:"结束时间不能小于起始时间"
}
});
<div style="margin:20px 0px 20px 70px">
<span>有效期起始时间:</span><input id='expireStartTimeUp'data-options="required:true" name="expireStartTime" class='easyui-datebox'>
<br>
<br>
<span>有效期结束时间:</span><input id='expireEndTimeUp' data-options="required:true,validType:'compareTime'" name="expireEndTime" class='easyui-datebox'>
</div>