Click here to Skip to main content
15,893,588 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I am using FullCalendar Javascript from arshaws fullcalnedar site,
I have been created a Json object, which contains all the events saved in db.
Now i want to pass this json object to script.
Posted
Updated 4-Sep-18 21:38pm
Comments
Mohibur Rashid 18-Sep-12 4:43am    
How did you create the json object?

1 solution

var obj = [];
           tmp = { 'title': 'event-1', 'start': '2018-09-05T12:30:00', 'end': '2018- 09-05T13:15:00', 'allDay': false };
           tmp += { 'title': 'event-2', 'start': '2018-09-05T15:30:00', 'end': '2018-09-05T16:00:00', 'allDay': false };
           tmp += { 'title': 'event-4', 'start': '2018-09-06T15:30:00', 'end': '2018-09-06T16:00:00', 'allDay': false };
           obj.push(tmp);
           $('#calendar').fullCalendar('events', events);
 
Share this answer
 
Comments
Richard Deeming 5-Sep-18 12:56pm    
That code will give you an array containing a single string element, with the value: "[object Object][object Object][object Object]"

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900