hasMonthEndDay function
Check if a date contains a month end day.
date
containing the month to check.
Implementation
bool hasMonthEndDay(DateTime date) {
if (isLeapYear(date.year) && date.month == 2) {
return date.day == 29;
}
return daysInMonth[date.month - 1] == date.day;
}