UNPKG

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