addMonthsToMonthDate static method

Jalali addMonthsToMonthDate(
  1. Jalali monthDate,
  2. int monthsToAdd
)

Returns a Jalali that is monthDate with the added number of months and the day set to 1 and time set to midnight.

For example:

Jalali date = Jalali(2019, 1, 15);
Jalali futureDate = DateUtils.addMonthsToMonthDate(date, 3);

date would be January 15, 2019. futureDate would be April 1, 2019 since it adds 3 months.

Implementation

static Jalali addMonthsToMonthDate(Jalali monthDate, int monthsToAdd) {
  return Jalali(monthDate.year, monthDate.month).addMonths(monthsToAdd);
}