Last active
February 18, 2019 23:28
-
-
Save poteto/20f1a19bad7740ec6f47f90b873d2795 to your computer and use it in GitHub Desktop.
Quick and dirty script to generate some random dates. Copy/paste into your console, it will copy those dates into your clipboard.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const COUNT = 32; | |
const START_DATE = new Date(2019, 0, 1); | |
const END_DATE = new Date(2019, 11, 31); | |
function randomDate(start, end) { | |
return new Date( | |
start.getTime() + Math.random() * (end.getTime() - start.getTime()) | |
); | |
} | |
copy( | |
Array.apply(null, { length: COUNT }).map(() => | |
randomDate(START_DATE, END_DATE) | |
) | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment