MaskedEditText icon indicating copy to clipboard operation
MaskedEditText copied to clipboard

Unable to validate month and year

Open shuBomb opened this issue 3 years ago • 0 comments

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));
        }
    }

shuBomb avatar Jun 24 '21 19:06 shuBomb