setMonth method

void setMonth(
  1. int newMonth
)

Sets only the month value.

Implementation

void setMonth(int newMonth) {
  final validMonth = newMonth.clamp(1, 12);
  month.value = validMonth;
  final daysInMonth = DateTime(year.value, validMonth + 1, 0).day;
  day.value = day.value.clamp(1, daysInMonth);
}