code: public final void setDate(LocalDate optionalDate) {
          // Set the text field to the supplied date, using the standard format for null, AD, or BC.
          String standardDateString = zGetStandardTextFieldDateString(optionalDate);
          String textFieldString = dateTextField.getText();
          // We will only change the date, when the text or the last valid date does not match the
          // supplied date. This will prevent any registered date change listeners from receiving
          // any events unless the date actually changes.
          if ((!standardDateString.equals(textFieldString))) {
              zInternalSetDateTextField(standardDateString);
          }
      }
docs: setDate, This sets this date picker to the specified date. Dates that are set from this
  function are processed through the same validation procedures as dates that are entered by
  the user.
  
  More specifically:
  
  The "veto policy" and "allowEmptyTimes" settings are used to determine whether or not a
  particular value is "allowed".
  
  Allowed values will be set in the text field, and also committed to the "last valid value".
  Disallowed values will be set in the text field (with a disallowed indicator font), but will
  not be committed to the "last valid value".
  
  A date value can be checked against any current veto policy, and against the allowEmptyDates
  setting, by calling isDateAllowed(). This can be used to determine (in advance), if a
  particular value would be allowed.
  
  Note: If empty dates are allowed, and the component does not have a veto policy, then all
  possible values will (always) be allowed. These are the default settings of this component.
  
  Implementation Note: Whenever the text field changes to a valid date string, the
  lastValidDate is also automatically set (unless the date is vetoed). This occurs through the
  DocumentListener which is registered on the dateTextField.