Skip to content

imrvelj/moment-random

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
src
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

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 )

About

Generates a random momentjs object

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published