code: public void setFormatForDatesCommonEra(DateTimeFormatter formatForDatesCommonEra) {
          this.formatForDatesCommonEraStrict
              = formatForDatesCommonEra.withResolverStyle(ResolverStyle.STRICT);
          if (parentDatePicker != null) {
              parentDatePicker.setTextFieldToValidStateIfNeeded();
          }
          // Changing the format for AD dates can change the default minimum width of the text field.
          // So if needed, set the appropriate minimum width.
          if (parentDatePicker != null) {
              parentDatePicker.zSetAppropriateTextFieldMinimumWidth();
          }
      }
docs: setFormatForDatesCommonEra, This sets the format that is used to display or parse CE dates in
  the date picker, from a DateTimeFormatter instance. The default value for the date format is
  generated using the locale of the settings instance.
  
  For most desired date formats, it would probably be easier to use the other "pattern string"
  version of this function. (which accepts a date pattern string instead of a DateTimeFormatter
  instance.)
  
  The various codes for the date pattern string are described at this link:
  https://docs.oracle.com/javase/8/docs/api/java/time/format/DateTimeFormatter.html
  
  If the date picker has already been constructed, then calling this function will cause
  immediate validation of the text field text.
  
  Note: Changing the format for CE dates may also change the default minimum width of the date
  picker text field.