![]() |
VOOZH | about |
The date-and-time.Date.isValid() is a minimalist collection of functions for manipulating JS date and time module which is used to validate the particular date and time with its string format.
Required Module: Install the module by npm or used it locally.
npm install date-and-time --save
<script src="/path/to/date-and-time.min.js"></script>
Syntax:
isValid(arg1[, arg2])
Parameters: This method takes the following arguments as parameters:
Return Value: This method returns true if and only if the terms are validated.
Example 1:
Run the index.js file using the following command:
node index.js
Output:
Date is not invalid
Example 2:
Run the index.js file using the following command:
node index.js
Output:
Date is valid