var currentY = new Date().getFullYear(); var currentM = new Date().getMonth() + 1; var lastDay = new Date(currentY, currentM, 0).getDate(); let start = `${currentY}-${currentM}-01` let end = `${currentY}-${currentM}-${lastDay}`
得到2022-11-01和2022-11-30 lastDay为获取到最后一天