GetEndDate method

dynamic GetEndDate(
  1. int monthEnd,
  2. int yearEnd
)

Implementation

GetEndDate(int monthEnd, int yearEnd) {
  /*setState(() {
    currentmonthEnd = DateFormat("MMM").format();
    currentYear = DateFormat("yyyy").format(today);
  });*/
  var date = DateTime(yearEnd, monthEnd + 1, 0);
  String formattedTime = DateFormat("MMM").format(date);
  String findYear = DateFormat('yyyy').format(date);
  print(date);
  print(findYear);
  currentYear = findYear;
  var date1 = DateTime(yearEnd, monthEnd, 1);
  print(date1);
  String weekDays = DateFormat("EEE").format(date1);
  print(weekDays);
  for (int i = 0; i < weekList.length; i++) {
    if (weekList[i].toString() == weekDays) {
      startPosition = i;
      break;
    }
  }
  currentMonth = formattedTime;

  setState(() {
    month = monthEnd;
    year = yearEnd;
    currentMonth;
    currentYear;
    endDate = date.day.toInt();
  });
  print(endDate);
  GetMap(endDate, startPosition);
}