# maxDate

> Value (Date or anything `new Date()` parses) must be ≤ `max`. Empty values pass.

Source: https://ngwr.dev/reference/validators/max-date  
Kind: Validator

## Live demo

Maximum is 2026-12-31 — later dates fail.

## Usage

```angular-ts
import { FormControl } from '@angular/forms';
import { WrValidators } from 'ngwr/validators';

const end = new FormControl('', [
  WrValidators.maxDate('2026-12-31'),
]);
```

## Why ngwr provides this

Angular's `Validators.max` is numeric-only. This compares dates — `Date` instances or anything `new Date()` parses — and pairs naturally with [wr-date-picker](https://ngwr.dev/reference/components/date-picker).

## API

| Name | Description | Type | Default |
| --- | --- | --- | --- |
| `signature` | Factory — call with a `Date` or any value `new Date(v)` accepts. | `(max: Date \| string \| number) => ValidatorFn` | `—` |
| `error key` | On failure: `{ maxDate: { max: Date } }`. Empty value passes. | `{ maxDate: { max } }` | `—` |

## See also

- [wr-date-picker](https://ngwr.dev/reference/components/date-picker) — Calendar-popup input - pair it with maxDate for range ceilings.
- [wr-calendar](https://ngwr.dev/reference/components/calendar) — Inline month view with its own [max] guard.
- [minDate](https://ngwr.dev/reference/validators/min-date) — The matching lower-bound rule.
