function showColor(){
$("#deviceLst tr:not(:eq(0)) td:nth-child(10)").each(function(){ //不是第一行,是第10页
var diff = DateDiff($(this).text(),new Date());
if(diff >=60){
$(this).css("color","green");
}else if (diff < 0) {
$(this).css("color","red");
} else {
$(this).css("color","blue");
}
});
}
function DateDiff(sDate1,sDate2){
var aDate, oDate1, oDate2, iDays ;
aaDate = sDate1.split("-");
oDate1 = new Date(aaDate[0] + '-' + aaDate[1] + '-' + aaDate[2]) ;
iDays = parseInt((oDate1 - sDate2) / 1000 / 60 / 60 /24);
return iDays;
}
$("#deviceLst tr:not(:eq(0)) td:nth-child(10)").each(function(){ //不是第一行,是第10页
var diff = DateDiff($(this).text(),new Date());
if(diff >=60){
$(this).css("color","green");
}else if (diff < 0) {
$(this).css("color","red");
} else {
$(this).css("color","blue");
}
});
}
function DateDiff(sDate1,sDate2){
var aDate, oDate1, oDate2, iDays ;
aaDate = sDate1.split("-");
oDate1 = new Date(aaDate[0] + '-' + aaDate[1] + '-' + aaDate[2]) ;
iDays = parseInt((oDate1 - sDate2) / 1000 / 60 / 60 /24);
return iDays;
}