# CalendarConstraints.DateValidator

[View Source](https://github.com/material-components/material-components-android/blob/1.14.0/lib/java/com/google/android/material/datepicker/CalendarConstraints.java)

*** ** * ** ***


```
public interface CalendarConstraints.DateValidator
```

<br />

Known direct subclasses [CompositeDateValidator](https://developer.android.com/reference/com/google/android/material/datepicker/CompositeDateValidator), [DateValidatorPointBackward](https://developer.android.com/reference/com/google/android/material/datepicker/DateValidatorPointBackward), [DateValidatorPointForward](https://developer.android.com/reference/com/google/android/material/datepicker/DateValidatorPointForward)

|---|---|
| `https://developer.android.com/reference/com/google/android/material/datepicker/CompositeDateValidator` | A `https://developer.android.com/reference/com/google/android/material/datepicker/CalendarConstraints.DateValidator` that accepts a list of Date Validators. |
| `https://developer.android.com/reference/com/google/android/material/datepicker/DateValidatorPointBackward` | A `https://developer.android.com/reference/com/google/android/material/datepicker/CalendarConstraints.DateValidator` that enables only dates before a given point. |
| `https://developer.android.com/reference/com/google/android/material/datepicker/DateValidatorPointForward` | A `https://developer.android.com/reference/com/google/android/material/datepicker/CalendarConstraints.DateValidator` that enables dates from a given point forward. |

*** ** * ** ***

Used to determine whether calendar days are enabled.

Extends Parcelable in order to maintain the `DateValidator` across device configuration changes. Parcelable breaks when passed between processes.

## Summary

| ### Public methods |
|---|---|
| `abstract boolean` | `https://developer.android.com/reference/com/google/android/material/datepicker/CalendarConstraints.DateValidator#isValid(long)(long date)` Returns true if the provided `date` is enabled. |

## Public methods

### isValid

```
abstract boolean isValid(long date)
```

Returns true if the provided `date` is enabled.