R
R
rinatoptimus2016-02-02 15:45:45
Angular
rinatoptimus, 2016-02-02 15:45:45

How to implement date validation in Angular 2?

In the calendar that falls out of the input, everything is fine: it will not work to enter 02/31/2016. But if you enter this date from the keyboard, no errors or warnings are issued.
The input code looks like this:

<input type="date" ng-model="someDate" class="form-control input-sm">

The official documentation for Ang 1 also has the same problem: https://docs.angularjs.org/api/ng/input/input%5Bdate%5D

Answer the question

In order to leave comments, you need to log in

1 answer(s)
P
Pavel Kuznetsov, 2016-02-02
@DiegoV

After filling the input, check its contents and reset if the value is invalid for any of the conditions.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question