hasYearPassed static method

bool hasYearPassed(
  1. int year,
  2. DateTime now
)

Determines whether or not the input year has already passed.

@param year the input year, as a two or four-digit integer @param now, the current time @return {@code true} if the input year has passed the year of the specified current time {@code false} otherwise.

Implementation

static bool hasYearPassed(int year, DateTime now) {
  int normalized = normalizeYear(year, now);
  return normalized < now.year;
}