Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
CreditCardForm.prototype._onSplitDateChange = function () {
var validationResult;
var month = this.get('expirationMonth.value');
var year = this.get('expirationYear.value');
var monthValidation = validator.expirationMonth(month);
var yearValidation = validator.expirationYear(year);
if (monthValidation.isValid && yearValidation.isValid) {
validationResult = validator.expirationDate(month + year);
this.set('expirationMonth.isValid', validationResult.isValid);
this.set('expirationMonth.isPotentiallyValid', validationResult.isPotentiallyValid);
this.set('expirationYear.isValid', validationResult.isValid);
this.set('expirationYear.isPotentiallyValid', validationResult.isPotentiallyValid);
} else {
this.set('expirationMonth.isValid', monthValidation.isValid);
this.set('expirationMonth.isPotentiallyValid', monthValidation.isPotentiallyValid);
this.set('expirationYear.isValid', yearValidation.isValid);
this.set('expirationYear.isPotentiallyValid', yearValidation.isPotentiallyValid);
}
};