$scope.transformer = function(hour, minute, loopTime, weekType){
var now = new Date();
if (weekType == undefined) {
weekType = now.getDay();
}
//转化到秒
var difference = (now.getDay() * 24 * 60 * 60 + now.getHours() * 60 *60 + now.getMinutes()*60+now.getSeconds())
- (weekType * 24 * 60 *60+ hour * 60 *60+ minute*60);
var timestamp = now.getTime();
//增加loopTime天
if (difference > 0) {
timestamp += loopTime * 24 * 60 * 60 * 1000;
}
timestamp -= difference * 1000;
var timeResult =parseInt(timestamp/1000);
return timeResult;
}
}])