JavaScript: Date format validator

Were many situations when I need to validate the date using clean JavaScript without using an external library like moment.js or jQuery.Below is a function which use RegEx expression to…