在日期上加指定的月数

@param
@param
@return
968179
public static Date addMonth(Date date1, int addMonth) {
        Date resultDate = null;
        Calendar c = Calendar.getInstance();
        c.setTime(date1); // 设置当前日期
        c.add(Calendar.MONTH, addMonth); // 日期加1
        resultDate = c.getTime(); // 结果
        return resultDate;
    }
496721
public static int addMonths(int date, int m) {
		int y0 = (int) DateTimeUtils.unixDateExtract(TimeUnitRange.YEAR, date);
		int m0 = (int) DateTimeUtils.unixDateExtract(TimeUnitRange.MONTH, date);
		int d0 = (int) DateTimeUtils.unixDateExtract(TimeUnitRange.DAY, date);
		int y = m / 12;
		y0 += y;
		m0 += m - y * 12;
		int last = lastDay(y0, m0);
		if (d0 > last) {
			d0 = 1;
			if (++m0 > 12) {
				m0 = 1;
				++y0;
			}
		}
		return DateTimeUtils.ymdToUnixDate(y0, m0, d0);
	}
642040
public static Date plusMonths(Date date, int months) {
		return plus(date, months, DateTimeField.MONTH);
	}
1272780
public XMLGregorianCalendar newGMonth(int month) {
        XMLGregorianCalendar cal=dataFactory.newXMLGregorianCalendar();
        cal.setMonth(month);
        return cal;
    }
336979
public boolean match(int value, int month, boolean isLeapYear) {
		return (super.match(value) // 在约定日范围内的某一天
				//匹配器中用户定义了最后一天（32表示最后一天）
				|| (value > 27 && match(32) && isLastDayOfMonth(value, month, isLeapYear)));
	}
330635
private int getMonthLength(int year, int month) {
        int days = DAYS_IN_MONTH[month];
        if (month == FEBRUARY && isLeapYear(year)) {
            days++;
        }
        return days;
    }
859291
public Date add(Date date) {
		Calendar c = Calendar.getInstance();
		c.setTime(date);

		if (weeks != null) {
			int weeks = this.weeks * (prior ? -1 : 1);
			c.add(Calendar.DATE, weeks * 7);
		}
		if (days != null) {
			int days = this.days * (prior ? -1 : 1);
			c.add(Calendar.DATE, days);
		}
		if (hours != null) {
			int hours = this.hours * (prior ? -1 : 1);
			c.add(Calendar.HOUR_OF_DAY, hours);
		}
		if (minutes != null) {
			int minutes = this.minutes * (prior ? -1 : 1);
			c.add(Calendar.MINUTE, minutes);
		}
		if (seconds != null) {
			int seconds = this.seconds * (prior ? -1 : 1);
			c.add(Calendar.SECOND, seconds);
		}

		return c.getTime();
	}
992425
@Nullable
  public static Month getAsMonth (final int nMonth)
  {
    if (nMonth < 1 || nMonth > 12)
      return null;
    return Month.of (nMonth);
  }
1251576
public static Calendar addMonths(Calendar origin, int value) {
        Calendar cal = sync((Calendar) origin.clone());
        cal.add(Calendar.MONTH, value);
        return sync(cal);
    }
498524
function getMonthDays(timestamp = Date.now()) {
  const cursorDay = new Date(new Date(timestamp).setDate(1));
  const currentMonth = cursorDay.getMonth();
  const days = [];
  while (cursorDay.getMonth() === currentMonth) {
    days.push(cursorDay.getTime());
    cursorDay.setDate(cursorDay.getDate() + 1);
  }
  return days;
}
1309204
function(date) {
        var monthLabel  = this.Locale.LOCALE_MONTHS[date.getMonth()] + this.Locale.MY_LABEL_MONTH_SUFFIX,
            yearLabel = (date.getFullYear() + this.Locale.YEAR_OFFSET) + this.Locale.MY_LABEL_YEAR_SUFFIX;

        if (this.Locale.MY_LABEL_MONTH_POSITION == 2 || this.Locale.MY_LABEL_YEAR_POSITION == 1) {
            return yearLabel + monthLabel;
        } else {
            return monthLabel + yearLabel;
        }
    }
1102996
private static Map<String, Integer> getMonthNames(Locale locale) {
		Map<String, Integer> r = MONTH_NAMES_CACHE.get(locale);
		if (r == null) {
			DateFormatSymbols symbols = DateFormatSymbols.getInstance(locale);
			r = new HashMap<>(24);
			
			//insert long month names
			String[] months = symbols.getMonths();
			for (int i = 0; i < months.length; ++i) {
				String m = months[i];
				if (!m.isEmpty()) {
					r.put(m.toUpperCase(), i + 1);
				}
			}
			
			//insert short month names
			String[] shortMonths = symbols.getShortMonths();
			for (int i = 0; i < shortMonths.length; ++i) {
				String m = shortMonths[i];
				if (!m.isEmpty()) {
					r.put(m.toUpperCase(), i + 1);
				}
			}
			MONTH_NAMES_CACHE.put(locale, r);
		}
		
		return r;
	}
492806
@Override
    public void setUpdatePeriod(final String updatePeriod) {
        if (!PERIODS.contains(updatePeriod)) {
            throw new IllegalArgumentException("Invalid period [" + updatePeriod + "]");
        }
        this.updatePeriod = updatePeriod;
    }
928685
public static int getMonthLength(int year, int month) {

		if ((month < 1) || (month > 12)) {
			throw new IllegalArgumentException("Invalid month: " + month);
		}
		if (month == 2) {
			return isLeapYear(year) ? 29 : 28;
		}

		return MONTH_LENGTH[month];
	}
615728
function addMonths(d, n) {
  var newDate = clone(d);
  newDate.setMonth(d.getMonth() + n);
  return newDate;
}
647738
private LocalDate calculateIMMMonth(final boolean requestNextIMM, final LocalDate startDate, final int month) {
        int monthOffset;
        LocalDate date = startDate;
        switch (month) {
        case MARCH:
        case JUNE:
        case SEPTEMBER:
        case DECEMBER:
            final LocalDate immDate = calculate3rdWednesday(date);
            if (requestNextIMM && !date.isBefore(immDate)) {
                date = date.plusMonths(MONTHS_IN_QUARTER);
            } else if (!requestNextIMM && !date.isAfter(immDate)) {
                date = date.minusMonths(MONTHS_IN_QUARTER);
            }
            break;

        default:
            if (requestNextIMM) {
                monthOffset = (MONTH_IN_YEAR - month) % MONTHS_IN_QUARTER;
                date = date.plusMonths(monthOffset);
            } else {
                monthOffset = month % MONTHS_IN_QUARTER;
                date = date.minusMonths(monthOffset);
            }
            break;
        }
        return date;
    }
1073893
public static Temporal edate(EvaluationContext ctx, Object date, Object months) {
        Temporal dateOrDateTime = Conversions.toDateOrDateTime(date, ctx);
        int _months = Conversions.toInteger(months, ctx);
        return dateOrDateTime.plus(_months, ChronoUnit.MONTHS);
    }