Validator

minDate

Value (Date or anything new Date() parses) must be ≥ min. Empty values pass.

Live demo

Minimum is 2026-01-01 — earlier dates fail.

errors: null

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

NameDescriptionTypeDefault
signatureFactory — call with a Date or any value new Date(v) accepts (ISO string, epoch ms).(min: Date | string | number) => ValidatorFn
error keyOn failure: { minDate: { min: Date } }. Empty value passes.{ minDate: { min } }

See also