<input type="datetime-local" step="1">
In that, how to avoid invalid date input. Suppose I am insert date like "11:11:1111" in "mm-dd-yyyy" format. how can solve this using Moment.js
<input type="datetime-local" step="1">
In that, how to avoid invalid date input. Suppose I am insert date like "11:11:1111" in "mm-dd-yyyy" format. how can solve this using Moment.js
Copyright © 2021 Jogjafile Inc.
Try using the isValid() method to make sure the DateTime is valid, or see my second example of checking if a date is older than a specified year. Example:
In the example above, if you try and enter a date such as 11/11/11111, it will say that it is invalid. If you want to prevent dates that are before a specified year, you can use the following:
If you enter a year older than 1900, such as 01/01/1899, in the example code above, it will say it is invalid.
I hope this has helped your problem.