let date = '2021年11月' // console.log(`${date.split('年')[0]}-${date.split('年')[1].split('月')[0]}`) date = `${date.split('年')[0]}-${date.split('年')[1].split('月')[0]}` console.log(date) let date1 = '2021-04-08' // console.log(date1.slice(0,7)) let obj = [ { date:'2021-10-20' }, { date:'2021-11-20' }, { date:'2021-11-20' } ] obj = obj.filter( item => item.date.slice(0,7) === date) console.log(obj)