code: private void adjustDayInMonthIfNeeded(int month, int year) {
          int day = mCalendar.get(Calendar.DAY_OF_MONTH);
          int daysInMonth = DateTimePickerUtils.getDaysInMonth(month, year);
          if (day > daysInMonth) {
              mCalendar.set(Calendar.DAY_OF_MONTH, daysInMonth);
          }
      }
docs: e.g. Switching from 2012 to 2013 when Feb 29, 2012 is selected -> Feb 28, 2013