/**
* 比较两个时间的大小
* 时间格式:yyyy-MM-dd hh:mm:ss
* @param {Object} beginTime 开始时间
* @param {Object} endTime 结束时间
*/
var getDataLarge = function(beginTimeString,endTimeString){
var b = beginTimeString.replace(/-/g,'/');
var e = endTimeString.replace(/-/g,'/');
var bs = Date.parse(b);
var es = Date.parse(e);
// console.log(bs);
// console.log(es);
var disparityTime =(es-bs)/3600/1000;
return disparityTime;
}
var beginTime1 = "2011-01-01";
var endTime1 = "2011-02-01";
//开始时间日期拼接
var start_date_time = beginTime1 +" "+"00"+":"+"01"+":00";
//结束时间日期拼接
var end_date_time = endTime1 +" "+"00"+":"+"01"+":00";
// disparityTime>0 结束时间大, disparityTime0结束时间小, disparityTime=0 日期相等
var disparityTime = getDataLarge(start_date_time,end_date_time);
if(disparityTime0){
alert("开始时间大");
}else if (disparityTime>0){
alert("结束时间大");
}else if (disparityTime==0){
alert("相等");
}