const getDate = (start,end) => { const result = [] start = new Date(start).getTime() end = new Date(end).getTime() for(let i = start;i<=end;i+=(24*60*60*1000)){ let date = new Date(i) result.push(date.getFullYear()+'-'+(date.getMonth() + 1)+'-'+(date.getDate())) } return result }
const getDate = (start,end) => { const result = [] start = new Date(start).getTime() end = new Date(end).getTime() for(let i = start;i<=end;i+=(24*60*60*1000)){ let date = new Date(i) result.push(date.getFullYear()+'-'+(date.getMonth() + 1)+'-'+(date.getDate())) } return result }
["2018-2-8", "2018-2-9", "2018-2-10", "2018-2-11", "2018-2-12", "2018-2-13", "2018-2-14", "2018-2-15", "2018-2-16", "2018-2-17", "2018-2-18", "2018-2-19", "2018-2-20", "2018-2-21", "2018-2-22", "2018-2-23", "2018-2-24", "2018-2-25", "2018-2-26", "2018-2-27", "2018-2-28", "2018-3-1", "2018-3-2", "2018-3-3"]
第 134 题:求两个日期中间的有效日期