我通过Ajax调用将数据加载到eventSource, 然后我将数据检索为..
eventSources:
[
// your event source
{
url: '/ajax-load-holidaysExtra',// use the `url` property
type: 'POST',
datatype: "JSON",
data : function()
{ // a function that returns an object
var date = new Date($('#calendar1').fullCalendar('getDate'));
month_integer = date.getMonth();
year_integer = date.getFullYear();
return {
month: month_integer,
year: year_integer
}
},
error: function() {
alert('there was an error while fetching eventsin hol!');
},
color: 'rgba(244, 221, 38, 0.20)', // a non-ajax option
textColor: 'blue' // a non-ajax option
}
],
但是我得到的日历中显示的日期不正确,它显示的日期比我打算从 eventSource 获取的日期早 1 或 2 天。
我是完整日历的新手,请任何人帮忙......我将不胜感激
最佳答案
我找到了答案
即使数据是正确的,日历的格式也不合适......
events: [
{
title: 'Event1',
start: '2011-04-04'
},
{
title: 'Event2',
start: '2011-05-05'
}
// etc...
],
如文档中所示,月份应为 2011-04-04
,但在我的数据中,它是 2011-4-4
所以结果是完整的日历显示另一天。
..希望这对某人有用,所以这就是为什么我保留这个问题..如果有任何建议可供讨论...
关于javascript - 完整日历加载事件源,天数显示的位置不正确,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41463028/