setDay method

void setDay(
  1. int newDay
)

Sets only the day value.

Implementation

void setDay(int newDay) {
  final daysInMonth = DateTime(year.value, month.value + 1, 0).day;
  day.value = newDay.clamp(1, daysInMonth);
}