JSP判断日期间隔天数
var temp_field1 = $("#temp_field1").val();
var temp_field2 = $("#temp_field2").val();
var d1 = new Date(temp_field1.replace(/-/g,"/"));
var d2 = new Date(temp_field2.replace(/-/g,"/"));
var times = d2.getTime()-d1.getTime();
var days = times/(24*60*60*1000);
if(temp_field1 !="" && temp_field2 !="" && days > 6){
alert("日期间隔不允许超过7天");
return;
}