Validation

When used with [ngModel] or [formControl], date & time picker provides control validation.


Examples


Invalid input

View on GitHub

If input value isn't a vaild date string, a validation error will be shown. Change the input field value to see it in action.

Min & max date validation

View on GitHub
Selected value should be after "1/13/25, 12:22 PM", received "1/10/25, 12:22 PM".

Selected value should be before "1/7/25, 12:22 PM", received "1/10/25, 12:22 PM".

Custom date filtering function

View on GitHub
Selected date can't be a Sunday.

Invalid date range

View on GitHub
"Range.to" should be greater than "range.from".