搜索文档
getMonths(start, end): string[]
start
end
string
获取两个日期之间的所有月份
Date
string[]
Example
const months = getMonths(new Date('2018-1-29'), new Date('2018-9-29')); console.log(months); // 输出: ['2018-1', '2018-2', '2018-3', '2018-4', '2018-5', '2018-6', '2018-7', '2018-8', '2018-9']