//1获取当前时间 var curTime = new Date(); //2把字符串格式转换为日期类 var startTime = new Date(Date.parse(kc.begintime)); var endTime = new Date(Date.parse(kc.endtime)); //3进行比较 return (curTime>=startTime && curTime<=endTime);
//1获取当前时间 var curTime = new Date(); //2把字符串格式转换为日期类 var startTime = new Date(Date.parse(kc.begintime)); var endTime = new Date(Date.parse(kc.endtime)); //3进行比较 return (curTime>=startTime && curTime<=endTime);