jQuery.validator.addMethod("endDate",
       function(value, element) {
           var startDate = $('#course\\.lifeStartDate').val();
           var endDate = $('#course\\.lifeEndDate').val();
           if(startDate.length==0 || endDate.length==0){//如果开始时间和结束时间有一个没输入,不做校验
                   return true;
           }
           return new Date(startDate.replace("-", "/").replace("-", "/")) < new Date(value.replace("-", "/").replace("-", "/"));

       },
       "结束日期必须大于开始日期!");

相关文章:

  • 2022-12-23
  • 2021-11-21
  • 2021-11-22
  • 2021-07-23
  • 2022-12-23
  • 2021-12-26
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-19
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案