Created
November 26, 2017 09:50
-
-
Save nomanHasan/07c960e20b6ecc23875b7975ec7e36a0 to your computer and use it in GitHub Desktop.
Auto Event Time Generations
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
getDemoDates = () => { | |
days = [] | |
for(i = 0; i< 1000; i++){ | |
d = new Date() | |
dif = Math.random() * 200 - 100 | |
d.setDate(dif) | |
days.push(d) | |
} | |
return days; | |
} | |
getDatesByHour = dateBH => { | |
number = Math.random() * 100 | |
datesBH = []; | |
for(i =0 ; i <number; i ++){ | |
dBH = dateBH | |
dBH.setHours(Math.random()*24); | |
datesBH.push(d) | |
} | |
return datesBH | |
} | |
getDemoDates().forEach(df => { | |
dates = dates.concat(getDatesByHour(df)) | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment