时间控件




    "project-font" width="11.5%">计划上线日期范围:
    "11.5%">
        
"input-project" style="z-index:15;height:27px;"> type="text" class="input-pro-input pickdate date0" id="onlineStartTime" name="onlineStartTime" readonly=readonly/>
"11.5%" align="center">-- "11.5%">
"input-project" style="z-index:15;height:27px;"> type="text" class="input-pro-input pickdate date0" id="onlineEndTime" name="onlineEndTime" readonly=readonly/>
//绑定计划上线日期范围 function bindStartEndTime(start,end){ $(start).datepicker({selectOtherMonths: true, dateFormat: 'yy-mm-dd', onClose: function(dateText, inst) { if ($(end).val() != '') { checkTimeValidate($(start),$(end),'start'); } } }); $(end).datepicker({selectOtherMonths: true, dateFormat: 'yy-mm-dd', onClose: function(dateText, inst) { if ($(start).val() != '') { checkTimeValidate($(start),$(end),'end'); } } }); } /*验证两个日期*/ function checkTimeValidate(start,end,operateItem){ var currentItem; if(operateItem == 'start'){ currentItem = start; }else if(operateItem == 'end'){ currentItem = end; } var testStartDate = $(start).val(); var testEndDate = $(end).val(); /*验证开始时间不能晚于结束时间*/ if (testStartDate != '' && testEndDate!='' && testStartDate > testEndDate){ currentItem.val(''); popMsg('error',"开始时间不能晚于结束时间",undefined,-1); } } //绑定计划开始结束日期 bindStartEndTime($("#onlineStartTime"),$("#onlineEndTime"));

你可能感兴趣的:(js,时间日期控件)