Package Exports
- random-hour
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (random-hour) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
random-hour
Generate a random hour.
Install
$ npm install --save random-hour
Usage
var randomHour = require('random-hour');
// API
// - randomHour([options]);
// options
// - twentyFour
// - min
// - max
By default, returns an hour from 1
to 12
for a standard 12-hour clock:
randomHour();
// => 9
Can optionally specify a full twenty-four:
randomHour({ twentyFour: true });
// => 14
Optionally specify min, max, or both to limit the range.
randomHour({ min: 10 });
// => 11
randomHour({ max: 10 });
// => 7
randomHour({ min: 5, max: 10 });
// => 8
Related
- random-year - Generate a random year.
- random-month - Generate a random month.
- random-day - Generate a random day of a month.
- 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.