bendrucker / angular-credit-cards

Angular directives for parsing and validating credit card inputs
MIT License
328 stars 98 forks source link

setting expiration date in controller #151

Closed all43 closed 7 years ago

all43 commented 7 years ago

Hi! I'm using cordova card.io plugin to scan card data and and angular-credit-cards for validation. After successful scan I can update model in controller. If I set cc-exp-month as string "09" and cc-exp-year as string "18" both inputs become invalid. Only way to pass validation is set month as Number(9) and year as Number(2018). But in this case validity month is displayed without leading zero, which looks confusing.

How can I set expiration month with leading zero and pass validation?

bendrucker commented 7 years ago

Hi, at the moment no leading zero is added for the month. You could certainly look at supporting this in a PR but it's a lot more complicated than the existing behavior.