Live demo
Maximum is 2026-12-31 — later dates fail.
Usage
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.
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 } } | — |