I have a an JSON file: example_json.json and this file looks like this:
{
"timeline":
{
"headline":"WELCOME",
"type":"default",
"text":"People say stuff",
"startDate":"10/4/2011 15:02:00",
"date": [
{
"startDate":"10/4/2011 15:10:00",
"endDate":"10/4/2011 15:55:00",
"headline":"prvo",
"text":"<p>dddddddddddddddd dd</p>",
"asset":
{
"caption":"yessss"
}
},
{
"startDate":"10/4/2011 17:02:00",
"endDate":"10/4/2011 18:02:00",
"headline":"drugo da da",
"text":"<p>In true political fashion, his character rattles off common jargon heard from people running for office.</p>",
"asset":
{
"media":"http://youtu.be/u4XpeU9erbg",
"credit":"",
"caption":""
}
}
]
}
}
so this is example of json file.
On other side I have this variables:
var place.name;
var zajson;
and: <button>Add to timeline</button>
Now I want when I click on button "add to timeline" to create new 'element' inside "date" with "startDate" to be: curentDateFormat in format month/day/year + zajson
and to add "headline" : place.name
How I can add this variables and create new element inside "date" in example_json.json?