Live demo
Minimum is 2026-01-01 — earlier dates fail.
Usage
import { FormControl } from '@angular/forms';
import { WrValidators } from 'ngwr/validators';
const start = new FormControl('', [
WrValidators.minDate('2026-01-01'),
]);
start.setValue('2025-12-31');
start.errors; // { minDate: { min: Date(2026-01-01) } }Why ngwr provides this
Angular's Validators.min 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 (ISO string, epoch ms). | (min: Date | string | number) => ValidatorFn | — |
error key | On failure: { minDate: { min: Date } }. Empty value passes. | { minDate: { min } } | — |