isYearCurrent property

bool get isYearCurrent

Checks if the date is in the current calendar year.

Returns: bool: True if the date is in the current year, false otherwise.

Implementation

// https://stackoverflow.com/questions/56427418/how-to-extract-only-the-time-from-datetime-now
bool get isYearCurrent => year == DateTime.now().year;