code: public boolean isTextValid(String text) {
          // If the text is null or the settings are null, return false.
          if (text == null || settings == null) {
              return false;
          }
          // If the text is empty, return the value of allowEmptyDates.
          text = text.trim();
          if (text.isEmpty()) {
              return settings.getAllowEmptyDates();
          }
          // Try to get a parsed date.
          LocalDate parsedDate = InternalUtilities.getParsedDateOrNull(
                  text, settings.getFormatForDatesCommonEra(),
                  settings.getFormatForDatesBeforeCommonEra(),
                  settings.getFormatsForParsing(), settings.getLocale());
  
          // If the date could not be parsed, return false.
          if (parsedDate == null) {
              return false;
          }
          // If the date is vetoed, return false.
          DateVetoPolicy vetoPolicy = settings.getVetoPolicy();
          if (InternalUtilities.isDateVetoed(vetoPolicy, parsedDate)) {
              return false;
          }
          // The date is valid, so return true.
          return true;
      }
docs: isTextValid, This function can be used to see if the supplied text represents a "valid date"
  according to the settings of this date picker.
  
  More specifically, this returns true if: 1) the text contains a parsable date that exists,
  and that has not been vetoed by a current veto policy, OR 2) (allowEmptyDates == true) and
  text.trim() contains an empty string. Otherwise returns false.