code: public boolean setDateRangeLimits(LocalDate firstAllowedDate, LocalDate lastAllowedDate) {
          if (!hasParent()) {
              throw new RuntimeException("DatePickerSettings.setDateRangeLimits(), "
                  + "A date range limit can only be set after constructing the parent "
                  + "DatePicker or the parent independent CalendarPanel. (The parent component "
                  + "should be constructed using the DatePickerSettings instance where the "
                  + "date range limits will be applied. The previous sentence is probably "
                  + "simpler than it sounds.)");
          }
          if (firstAllowedDate == null && lastAllowedDate == null) {
              return setVetoPolicy(null);
          }
          return setVetoPolicy(new DateVetoPolicyMinimumMaximumDate(
              firstAllowedDate, lastAllowedDate));
      }
docs: setDateRangeLimits, This is a convenience function, for setting a DateVetoPolicy that will
  limit the allowed dates in the parent object to a specified minimum and maximum date value.
  Calling this function will always replace any existing DateVetoPolicy.
  
  If you only want to limit one side of the date range, then you can pass in "null" for the
  other date variable. If you pass in null for both values, then the current veto policy will
  be cleared.
  
  Important Note: The DatePicker or independent CalendarPanel associated with this settings
  instance is known as the "parent component". This function can only be called after the
  parent component is constructed with this settings instance. If this is called before the
  parent is constructed, then an exception will be thrown. For more details, see:
  "DatePickerSettings.setVetoPolicy()".
  
  Return value: It's possible to set a veto policy that vetoes the currently selected date.
  This function returns true if the selected date is allowed by the new veto policy and the
  other current settings, or false if the selected date is vetoed or disallowed. Setting a new
  veto policy does not modify the selected date. Is up to the programmer to resolve any
  potential conflict between a new veto policy, and the currently selected date.