Last active
December 4, 2020 21:39
-
-
Save jhonsore/bac1bef18cfab24478960219c0baf6d5 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function validateDate(y, m, d) { | |
| var month = m-1; | |
| var _date = new Date(y, month, d); | |
| if(isNaN(_date)) return false; | |
| if (_date.getFullYear() != y | |
| || _date.getMonth() != month | |
| || _date.getDate() != d) { | |
| return false; | |
| } | |
| return _date; | |
| } | |
| export default validateDate; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment