MaskedEditText
MaskedEditText copied to clipboard
Unable to validate month and year
Hi, I am unable to add validation for month and year, How we can do that.
Currently this code is implemented and its not validate the month. I can able to enter more than 12 in month
@OnTextChanged(value = R.id.cardDateEditText, callback = OnTextChanged.Callback.AFTER_TEXT_CHANGED)
protected void onCardDateTextChanged(Editable s) {
if (!isInputCorrect(s, CARD_DATE_TOTAL_SYMBOLS, CARD_DATE_DIVIDER_MODULO, CARD_DATE_DIVIDER)) {
s.replace(0, s.length(), concatString(getDigitArray(s, CARD_DATE_TOTAL_DIGITS), CARD_DATE_DIVIDER_POSITION, CARD_DATE_DIVIDER));
}
}