moment-random

1.1.0 • Public • Published

moment-random

Build Status

Generates a new random moment.js object

Install

make sure you have moment installed

npm or yarn

$ npm install --save moment-random
$ yarn add moment-random

Usage


Just require it like any other library

const momentRandom = require('moment-random');
 
momentRandom();
// > random date in the past

You can also specify an interval

momentRandom(end)
// > random date between 0 unix time and {end} dates
 
momentRandom(end, start)
// > random date between {start} and {end} dates

Arguments

  • end, start - anything a moment constructor accepts (see moment.js docs )

Readme

Keywords

none

Package Sidebar

Install

npm i moment-random

Weekly Downloads

2,362

Version

1.1.0

License

MIT

Unpacked Size

3.53 kB

Total Files

4

Last publish

Collaborators

  • perpaer