// 获取最近的月份 num 参数为 7 ，获取的就是最近8个月份
export const getNearMonth = (num: number = 7) => {
  let date = new Date();
  let M = date.getMonth() + 1;

  let arr = [];
  for (let i = num; i > 0; i--) {
    let sixMonth = M - i;
    if (sixMonth <= 0) {
      sixMonth = 12 + sixMonth;
    }
    arr.push(sixMonth + "月");
  }
  arr.push(M + "月");
  return arr;
};
