In our application,we are using the javascript method, which validates credit card expiry date and returns true if the expiry date is greater than current date. A user reported that the application is not accepting the expiry date 08/2014 in IE 9 browser. When we launched IE in user machine,it opened in IE 9 Compat view browser mode and IE7 Document Standards.The method is failing only for the expiry dates 08/2014 and 09/2014. When we manually changed the browser mode to IE 9 and standards to IE9 ,it worked.I am not able to understand why IE is opening with IE9 Compat view mode and IE 7 standards.Do we need to enforce the IE to always open in IE9?
fnValidateExpiryDate('08/2014','02/20/2014');`
function fnValidateExpiryDate(expiryDate , currentDate) {
var regexp = /^((0[1-9])|(1[0-2]))\/(\d{4})$/;
if (!regexp.test(expiryDate)) {
return false;
}
var userDate = expiryDate.split('/');
var configDate = currentDate.split('/');
if (parseInt(userDate[1]) < parseInt(configDate[2])) {
return false;
}
if ((parseInt(userDate[1]) == parseInt(configDate[2])) && (parseInt(userDate[0]) < parseInt(configDate[0]))) {
return false;
}
return true;
}