I'm looking to create mock data following a specific structure.
Criteria:
The time interval for start and end times should be either 30 minutes or 1 hour.
Need to generate 2-3 mock entries for the same day with varying time intervals.
[{
Id: 1,
Subject: 'Bob',
StartTime: new Date(2020, 6, 11, 9, 30),
EndTime: new Date(2020, 6, 11, 11, 0),
CategoryColor: '#1aaa55'
}]
Below is the code snippet I have so far for generating this mock data,
However, I'm unsure about how to implement the data logic. Any assistance would be appreciated.
function random() {
for (let index = 0; index <= 100; index++) {
let x = {
Id: getRandomInt(1, 1000),
Subject: generateName(),
StartTime: new Date(2020, 6, 11, 9, 30),
EndTime: new Date(2020, 6, 11, 11, 0),
CategoryColor: getRandomColor()
}
data.push(x);
}
}