var s1 = new Date(date1.replace(/-/g, "/"));
var s2 = new Date(date2.replace(/-/g, "/")); var days = s1.getTime() - s2.getTime(); var time = parseInt(days / (1000 * 60 * 60 * 24));//下面是计算比例的1/天数,可以忽略
if(time<0){ for(var i=1;i<=5;i++){ $dp.$('row'+num+''+i).innerHTML=''; } }else{ for(var i=1;i<=time;i++){ $dp.$('row'+num+''+i).innerHTML=((1/time).toFixed(2))*100 +'%'; } }