Class DateVetoPolicyMinimumMaximumDate

java.lang.Object
com.github.lgooddatepicker.zinternaltools.DateVetoPolicyMinimumMaximumDate
All Implemented Interfaces:
DateVetoPolicy

public class DateVetoPolicyMinimumMaximumDate extends Object implements DateVetoPolicy
DateVetoPolicyMinimumMaximumDate, This class implements a veto policy that can set a minimum and a maximum value for the dates allowed in a DatePicker or a CalendarPanel. Pass in the first and the last allowed date to the constructor. If one of the values is null, then there will be no limiting date on the associated side of the date range. Only one of the two limiting dates can be null. If both dates are supplied, then the lastAllowedDate must be greater than or equal to the firstAllowedDate.
  • Constructor Details

    • DateVetoPolicyMinimumMaximumDate

      public DateVetoPolicyMinimumMaximumDate(LocalDate firstAllowedDate, LocalDate lastAllowedDate)
      Constructor. Pass in the first and the last allowed date. If one of the values is null, then there will be no limiting date on the associated side of the date range. Only one of the two limiting dates can be null. If both dates are supplied, then the lastAllowedDate must be greater than or equal to the firstAllowedDate.
  • Method Details

    • getDateRangeLimits

      public DateInterval getDateRangeLimits()
      getDateRangeLimits, This returns the currently used date limits, as a DateInterval object.
    • isDateAllowed

      public boolean isDateAllowed(LocalDate date)
      isDateAllowed, This implements the DateVetoPolicy interface. This returns true if the date is allowed, otherwise this returns false. The value of null will never be passed to this function, under any case.
      Specified by:
      isDateAllowed in interface DateVetoPolicy
    • setDateRangeLimits

      public void setDateRangeLimits(LocalDate firstAllowedDate, LocalDate lastAllowedDate)
      setDateRangeLimits, This sets the currently used date limits.