douyonglang4845 2017-01-04 11:46
浏览 48
已采纳

完整日历加载eventSource,天数不正确

I load the data to the eventSource through Ajax call, then i retrieve the data as.. i received as the response of Ajax call in event Source

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

            }

        ],

but i get the days which are shown in the calendar is not correct, it shows a date 1 or 2 days before the date which i intend to take from the eventSource..

I am new to full calendar please can anyone help...it will be grateful

  • 写回答

1条回答 默认 最新

  • donglu3243 2017-01-04 12:07
    关注

    I found the answer

    Even the data was correct the format was not okay with the calendar...

    events: [
        {
            title: 'Event1',
            start: '2011-04-04'
        },
        {
            title: 'Event2',
            start: '2011-05-05'
        }
        // etc...
    ],
    

    as in the documentation the month should be come as 2011-04-04 , but in my data it is 2011-4-4 so the result comes but full calendar shows a another day.

    ..hope this might be useful to someone, So that's why i keep this Question..if any suggestion open for discussion...

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥20 腾讯企业邮箱邮件可以恢复么
  • ¥15 有人知道怎么将自己的迁移策略布到edgecloudsim上使用吗?
  • ¥15 错误 LNK2001 无法解析的外部符号
  • ¥50 安装pyaudiokits失败
  • ¥15 计组这些题应该咋做呀
  • ¥60 更换迈创SOL6M4AE卡的时候,驱动要重新装才能使用,怎么解决?
  • ¥15 让node服务器有自动加载文件的功能
  • ¥15 jmeter脚本回放有的是对的有的是错的
  • ¥15 r语言蛋白组学相关问题
  • ¥15 Python时间序列如何拟合疏系数模型