I'm using ng-payment-card in my project and I had a serious issue in the expiration year's dropdown list, because the options contain only this year + a few years later only. anyone found a solution for this problem??
Asked
Active
Viewed 113 times
0
-
What's the issue and what are you trying to achieve. Explain the issue you are having – penleychan Jan 21 '22 at 15:55
-
@penleychan I think the issue is clear, I have a package to simulate a payment card and as normal the card's expiration year could be after 8 years from now, but in this package the maximum year is after 4 years from now – James.mikael Jan 24 '22 at 10:36
1 Answers
1
The years appear to be generated here:
public static getYears(): Array<number> {
const years: Array<number> = [];
const year = new Date().getFullYear();
for (let i = -2; i < 5; i++) {
years.push(year + i);
}
return years;
}
}
As you can see, that -2
is hardcoded. I think the best you can do is alter your local copy of the source; although that's probably inadvisable.

Carcigenicate
- 43,494
- 9
- 68
- 117