setDisabledEndDate method

DateTime? setDisabledEndDate({
  1. required CalendarInfo calendarInfo,
})

Implementation

DateTime? setDisabledEndDate({required CalendarInfo calendarInfo}) {
  DateTime? result;
  if (this.year == calendarInfo.year) {
    if (this.month == calendarInfo.month) {
      result = this;
    }
    if (this.month > calendarInfo.month) {
      result = DateTime(calendarInfo.year, calendarInfo.month + 1, 1);
    }
  } else if (this.year > calendarInfo.year) {
    result = DateTime(calendarInfo.year, calendarInfo.month + 1, 1);
  }
  return result;
}