<script type="text/javascript">
$(function() {
var date = new Date();
var d = date.getDate(),
m = date.getMonth(),
y = date.getFullYear();
$('#calendar').fullCalendar({
header: {
left: 'prev,next today',
center: 'title',
right: 'month,agendaWeek,agendaDay'
},
defaultDate: '2014-09-12',
editable: true,
eventLimit: true,
events: '/myCal'
});
});
</script>
my json feed :
{
"allDay":"false",
"end":"2014-09-03",
"id":"1",
"start":"2014-09-02",
"title":"EventXYZ"
}
<script>
events:
[
{
"allDay":"false",
"end":"2014-09-03",
"id":"1",
"start":"2014-09-02",
"title":"EventXYZ"
}
]
</script>
if i use the above code then it shows me on my calendar page.
i am working with struts2
and an action is returning json feed which I want to display in my calendar.
calendar action class has following content with getter and setter.
public CalendarAction() {
}
public String title;
public String start;
public String end;
public String id;
public String allDay;
public String execute() {
title = "EventXYZ";
start = "2014-09-02";
end = "2014-09-03";
id = "1";
allDay = "false";
return SUCCESS;
}
I am able to generate json
format.
but unable to add json data in calendar plugin.
confused that how to pass action in script or any url or ajax call.