startDate="2017-08-10"
по сегодняшние число?// такой результат
["2017-08-10","2017-08-11","2017-08-12","2017-08-13","2017-08-14"...]
var D = new Date("2017-08-27")
, Till = new Date()
, result = []
;
function pad(s){ return ('00' + s).slice(-2)}
while( D.getTime() < Till.getTime()) {
result.push( '' + D.getFullYear() +'-'+ pad(D.getMonth()+1) +'-'+ pad(D.getDate()));
D.setDate( D.getDate()+1);
}
// 2017-08-27,2017-08-28,2017-08-29,2017-08-30,2017-08-31
var dates=["2017-08-10","2017-08-11","2017-08-12","2017-08-13","2017-08-14"];
var start="2017-08-13"
function filterDate(dates=[],start){
let s=new Date(start);
let resDates=[];
q.forEach((dateStr=>{
let date=new Date(dateStr)
if(date>=s){
resDates.push(dateStr)
}
}))
return resDates;
}
console.log(filterDate(dates,start))