calculateYearDifference static method

int calculateYearDifference(
  1. DateTime dateA,
  2. int xMilliseconds
)

Implementation

static int calculateYearDifference(DateTime dateA, int xMilliseconds) {
  DateTime targetDate = dateA.add(Duration(milliseconds: xMilliseconds));
  int yearDiff = dateA.year - targetDate.year;
  return yearDiff;
}