function getDateList(target) {
const targetYear = target.split('-')[0], targetMouth = target.split('-')[1]
let year = target.split('-')[0], mouth = target.split('-')[1]
if (Number(mouth) === 12) {
year++
mouth = 1
} else {
mouth++
}
const nextMouth = `${year}-${mouth}`
const dateCount = new Date(new Date(nextMouth).setDate(0)).getDate()
const dateList = []
for (let i = 1; i <= dateCount; i++) {
dateList.push(`${targetYear}-${targetMouth}-${i}`)
}
return dateList
}
console.log(getDateList('2020-2'))