指定开始和结束时间,范围该范围内的所有日期放入数组
Date.prototype.addDays = function(days) { var dat = new Date(this.valueOf()); dat.setDate(dat.getDate() + days); return dat; }; function getDates(startDate, stopDate) { var dateArray = []; var currentDate = startDate; while (currentDate <= stopDate) { dateArray.push(self.formatDate(currentDate)); currentDate = currentDate.addDays(1); } return dateArray; }