diff options
Diffstat (limited to 'mock/index.js')
| -rw-r--r-- | mock/index.js | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/mock/index.js b/mock/index.js index ee04bff..fcf4dbf 100644 --- a/mock/index.js +++ b/mock/index.js @@ -44,11 +44,10 @@ function choice(a){ return a[ Math.floor(Math.random()*a.length) ]} function populateMeals (userid) { console.log(userid) - let date = null for (let i = 0; i < 30; i++) { - date = new Date () - date.setDate( date.getDate() - i ) for (let j = 0, count = randrange(3,5); j < count; j++) { + let date = new Date () + date.setDate( date.getDate() - i ) switch (j) { case 0: date.setHours(randrange(6,11)) |
