1 | # exp_month
|
2 |
|
3 | ```js
|
4 | // usage
|
5 | chance.exp_month()
|
6 | chance.exp_month({future: true})
|
7 | ```
|
8 |
|
9 | Generate a random credit card expiration month.
|
10 |
|
11 | ```js
|
12 | chance.exp_month();
|
13 | => '01'
|
14 | ```
|
15 |
|
16 | Optionally specify that it must be a later month than the current month.
|
17 |
|
18 | ```js
|
19 | chance.exp_month({future: true});
|
20 | => '10'
|
21 | ```
|
22 |
|
23 | So if called in June, this would return a random month from July - Dec. If
|
24 | called in October, would return November or December.
|
25 |
|
26 | This because many credit card sandboxes require an expiration date later
|
27 | than the current date so it's necessary when generating an expiration with the
|
28 | current year to generate a month later than the current month.
|