totalDaysInMonth property
int
get
totalDaysInMonth
Total days in the current month
Implementation
int get totalDaysInMonth
{
DateTime lastDayInMonth = new DateTime(year, month+1, 0); // Providing a day value of zero for the next month gives you the previous month's last day.
return lastDayInMonth.day;
}