leapYear property

bool leapYear

Returns true if this year is a leap year. because not all DateAdapters have the EfficientLeapYear mixin this method has a high chance of throwing an exception.

Implementation

bool get leapYear {
  if (referenceDate.adapter is EfficientLeapYear) {
    return (referenceDate.adapter as EfficientLeapYear)
        .isLeapYear(referenceDate.year);
  }
  throw 'Date adapter doesn\'t support leap year';
}