Closed ds0001 closed 9 years ago
Interesting, thanks!
What specifically was the problem you were having with the static length restriction?
I wanted to restrict it to 4 digits MMYY. The parseCardExpiry method allowed for 2 digits for year but the restrictExpiry method did not. I started with just using maxlength on the html input but felt it better to use a data attribute instead. Its possible the formatter could change from " / " to something else in which case the html input would have an incorrect maxlength attribute.
Appreciate the thought, but is there a specific reason you want to not allow for 4 digit years? You can easily prompt the user for this format (see the example page), in either case parsing the values turns out the same.
update restrictExpiry method to accept an override value from an html element data attribute 'data-maxlength'. Nmp tests run green and I didn't see any specific tests on this method so I didn't bother with a new test.