admin管理员组文章数量:1392059
I am trying to dynamicly add an event to my calendar
From the documentation i have gathered the following code:
$.ajax({
type: 'POST',
url: '/Calendar/findEvents',
dataType: 'json',
data: {
request: 'ajax'
},
success: function (data)
{
var date = new Date();
var d = date.getDate();
var m = date.getMonth();
var y = date.getFullYear();
$('.calendar').fullCalendar( 'renderEvent', event
[{
title: 'All Day Event',
start: new Date(y, m, d)
}]
);
}
});
However this does not seem to work.
i get the following error:
Uncaught TypeError: Cannot read property 'source' of undefined fullcalendar.min.js: 6
Can anyone tell me what i am missing or what i am doing wrong in order to add an event to my calendar?
I am trying to dynamicly add an event to my calendar
From the documentation i have gathered the following code:
$.ajax({
type: 'POST',
url: '/Calendar/findEvents',
dataType: 'json',
data: {
request: 'ajax'
},
success: function (data)
{
var date = new Date();
var d = date.getDate();
var m = date.getMonth();
var y = date.getFullYear();
$('.calendar').fullCalendar( 'renderEvent', event
[{
title: 'All Day Event',
start: new Date(y, m, d)
}]
);
}
});
However this does not seem to work.
i get the following error:
Uncaught TypeError: Cannot read property 'source' of undefined fullcalendar.min.js: 6
Can anyone tell me what i am missing or what i am doing wrong in order to add an event to my calendar?
Share Improve this question asked Aug 4, 2014 at 11:21 Marc RasmussenMarc Rasmussen 20.6k83 gold badges223 silver badges384 bronze badges1 Answer
Reset to default 6You should pass an object, and add true to fix the new event in the calendar :
var myevent = {title: 'All Day Event',start: new Date(y, m, d)};
$('.calendar').fullCalendar( 'renderEvent', myevent, true);
本文标签: javascriptFullCalendar js add eventStack Overflow
版权声明:本文标题:javascript - FullCalendar js add event - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744763582a2623896.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论