isValidDay static method
Validates if a day is valid for a given month and year
Handles leap years correctly
Returns true if the day is valid, false otherwise
Implementation
static bool isValidDay(int year, int month, int day) {
if (!isValidYear(year) || !isValidMonth(month)) {
return false;
}
final daysInMonth = DateCalculations.getDaysInMonth(year, month);
return day >= 1 && day <= daysInMonth;
}