You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
459 B
459 B
year
// usage
chance.year()
chance.year({min: 1900, max: 2100})
Generate a random year
chance.year();
=> '2053'
By default, min is the current year and max is 100 years greater than min.
This is returned as a string. If for some reason you need it numeric, just parse it:
parseInt(chance.year());
=> 2042
Optionally specify min, max, or both to limit the range.
chance.year({min: 1900, max: 2100});
=> '1983'