/**
*传过来两个字符串2015-1-5,2014-12-30 23:59:59格式
*返回true表示begin>end
*/
function dateCompare(begin, end){
if(end.length > 10){
end=end.substring(0,10);
}
var beginArrs = begin.split("-");
var beginTime = new Date(beginArrs[0], beginArrs[1], beginArrs[2]);
var beginTimes = beginTime.getTime();
var endArrs = end.split("-");
var endTime = new Date(endArrs[0], endArrs[1], endArrs[2]);
var endTimes = endTime.getTime();
if(beginTimes > endTimes){
return true;
}else{
return false;
}
}
*传过来两个字符串2015-1-5,2014-12-30 23:59:59格式
*返回true表示begin>end
*/
function dateCompare(begin, end){
if(end.length > 10){
end=end.substring(0,10);
}
var beginArrs = begin.split("-");
var beginTime = new Date(beginArrs[0], beginArrs[1], beginArrs[2]);
var beginTimes = beginTime.getTime();
var endArrs = end.split("-");
var endTime = new Date(endArrs[0], endArrs[1], endArrs[2]);
var endTimes = endTime.getTime();
if(beginTimes > endTimes){
return true;
}else{
return false;
}
}