random-month
v1.0.1
Published
Generate a random month.
Downloads
17,884
Maintainers
Readme
random-month
Generate a random month.
Install
$ npm install --save random-month
Usage
var randomMonth = require('random-month');
// API
// - randomMonth([options]);
// options
// - raw
// - min
// - max
By default, returns just the month number from 1
to 12
.
randomMonth();
// => 10
Optionally specify raw to get the whole month object:
randomMonth({ raw: true });
// => {name: 'October', short: 'Oct', number: 10, days: 31}
Optionally specify min, max, or both to limit the range.
randomMonth({ min: 10 });
// => 11
randomMonth({ max: 10 });
// => 7
randomMonth({ min: 3, max: 9 });
// => 6
Related
random-year - Generate a random year.
random-day - Generate a random day of a month.
random-hour - Generate a random hour.
random-minute - Generate a random minute.
random-second - Generate a random second.
random-millisecond - Generate a random millisecond.
random-weekday - Generate a random weekday.
random-datetime - Generate a random date.
random-ampm - Return am or pm. Very simple.
random-timestamps - Generate a timestamp.
random-hammertime - Generate a random hammertime.
Contributing
Pull requests and stars are highly welcome.
For bugs and feature requests, please create an issue.