calculateMonthDifference static method
Implementation
static int calculateMonthDifference(DateTime dateA, int xMilliseconds) {
DateTime targetDate = dateA.add(Duration(milliseconds: xMilliseconds));
int yearDiff = dateA.year - targetDate.year;
int monthDiff = dateA.month - targetDate.month;
int totalMonths = yearDiff * 12 + monthDiff;
return totalMonths;
}