Full Calendar + Access Dates via Nested JSON Feed

ⅰ亾dé卋堺 提交于 2019-12-11 11:46:33

问题


I am working on trying to implement Full Calendar via a JSON feed. I am having issues getting the data to derive from a nested object:

Data:

[{"id":22,"weeks":[{"title":"Testing New Filter","start":"2015-01-19","end":"2015-01-29","url":"http://localhost:3000/campaigns/testing-new-filter"},{"title":"Not this Feed","start":"2015-02-24","end":"2015-03-07","url":"http://localhost:3000/campaigns/not-this-feed"}]},{"id":23,"weeks":[]}]

Calendar Implementation:

$('#calendar').fullCalendar({
     eventSources: [

    // your event source
    {
        url: parser.pathname + '.json',
        error: function() {
            alert('there was an error while fetching events!');
        },
        color: 'yellow',   // a non-ajax option
        textColor: 'black' // a non-ajax option
    }

    // any other sources...

]   

    });

Stuck on how I get the data to pull from the 'weeks' start which is the child element

来源:https://stackoverflow.com/questions/28555275/full-calendar-access-dates-via-nested-json-feed

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!