normalizeYear static method

int normalizeYear(
  1. int year,
  2. DateTime now
)

Implementation

static int normalizeYear(int year, DateTime now) {
  if (year < 100 && year >= 0) {
    String currentYear = now.year.toString();
    String prefix = currentYear.substring(0, currentYear.length - 2);
    year = int.parse('$prefix$year');
  }
  return year;
}