[
{
"day": 0,
"periods": [
{
"start": "01:00",
"end": "02:00",
"title": "",
"backgroundColor": "rgba(254, 0, 0, 0.7)",
"borderColor": "rgb(42, 60, 255)",
"textColor": "rgb(0, 0, 0)"
},
{
"start": "02:30",
"end": "03:00",
"title": "",
"backgroundColor": "rgba(254, 0, 0, 0.7)",
"borderColor": "rgb(42, 60, 255)",
"textColor": "rgb(0, 0, 0)"
}
]
},
{
"day": 1,
"periods": [
{
"start": "01:00",
"end": "02:00",
"title": "",
"backgroundColor": "rgba(254, 0, 0, 0.7)",
"borderColor": "rgb(42, 60, 255)",
"textColor": "rgb(0, 0, 0)"
}
]
},
{
"day": 2,
"periods": [
{
"start": "01:00",
"end": "01:30",
"title": "",
"backgroundColor": "rgba(254, 0, 0, 0.7)",
"borderColor": "rgb(42, 60, 255)",
"textColor": "rgb(0, 0, 0)"
}
]
},
{
"day": 3,
"periods": [
{
"start": "02:00",
"end": "02:30",
"title": "",
"backgroundColor": "rgba(254, 0, 0, 0.7)",
"borderColor": "rgb(42, 60, 255)",
"textColor": "rgb(0, 0, 0)"
}
]
},
{
"day": 4,
"periods": [
{
"start": "01:00",
"end": "01:30",
"title": "",
"backgroundColor": "rgba(254, 0, 0, 0.7)",
"borderColor": "rgb(42, 60, 255)",
"textColor": "rgb(0, 0, 0)"
}
]
},
{
"day": 5,
"periods": [
{
"start": "01:30",
"end": "02:00",
"title": "",
"backgroundColor": "rgba(254, 0, 0, 0.7)",
"borderColor": "rgb(42, 60, 255)",
"textColor": "rgb(0, 0, 0)"
},
{
"start": "03:00",
"end": "03:30",
"title": "",
"backgroundColor": "rgba(254, 0, 0, 0.7)",
"borderColor": "rgb(42, 60, 255)",
"textColor": "rgb(0, 0, 0)"
}
]
},
{
"day": 6,
"periods": []
}
]
How to make such data structure with dynamic variables in Javascript? Lets say: I need to change periods[start] and periods[end] times in day:6 or day:2 I want to make new data2 structure like data,but with my variables of time. something like this :
for (var i=0; i <arr.legth; ++i){
data2="'[{"day":MYVARIABLE1,"periods":[{"start":"MYVARIABLE2","end":"MYVARIABLE3", ...}]';
}
data2is a string...