monthDelta static method

int monthDelta(
  1. Jalali startDate,
  2. Jalali endDate
)

Determines the number of months between two Jalali objects.

For example:

Jalali date1 = Jalali(2019, 6, 15);
Jalali date2 = Jalali(2020, 1, 15);
int delta = DateUtils.monthDelta(date1, date2);

The value for delta would be 7.

Implementation

static int monthDelta(Jalali startDate, Jalali endDate) {
  return (endDate.year - startDate.year) * 12 +
      endDate.month -
      startDate.month;
}