I am using a regex expression to validate that the date has a 4 digit year.
I am passing a string to this function and it is not working correctly.
Can someone help me with this?
When I pass 07/29/80 it returns false;
when I pass 07/29/1980 it returns false;
function isDate()
{
var dt = arguments[0];
var dateExpression = '^\d{2}\/\d{2}\/\d{4}$';
var dtval = dt.match(dateExpression);
if(!dtval){
return false;
}else{
return true;
}
}