code: public void setDateFormat(java.text.DateFormat dateFormat, java.text.DateFormat numbersDateFormat) {
          this.customDateFormat = dateFormat;
          this.secondaryDateFormat = numbersDateFormat;
          // update the spinner with the new date format:
  
          // the only spinner item that will be affected is the month item, so just toggle the flag twice
          // instead of rebuilding the whole adapter
          if(showMonthItem) {
              int monthPosition = getAdapterItemPosition(4);
              boolean reselectMonthItem = getSelectedItemPosition() == monthPosition;
              setShowMonthItem(false);
              setShowMonthItem(true);
              if(reselectMonthItem) setSelection(monthPosition);
          }
  
          // if we have a temporary date item selected, update that as well
          if(getSelectedItemPosition() == getAdapter().getCount())
              setSelectedDate(getSelectedDate());
      }
docs: Sets the custom date format to use for formatting Calendar objects to displayable strings.
  @param dateFormat The new DateFormat, or null to use the default format.
  @param numbersDateFormat The DateFormat for formatting the secondary date when both FLAG_NUMBERS
  and FLAG_WEEKDAY_NAMES are set, or null to use the default format.