Jquery Full Calendar json event source syntax

后端 未结 4 1375
栀梦
栀梦 2020-12-14 03:19

I\'m trying to use full calendar to load events from a json source. The json is from a URL like a feed, \"mysite.com/getEvents\" (which returns a json event object). Right n

4条回答
  •  醉话见心
    2020-12-14 04:10

    You should try forming the JSON so it has all the required fields. For example, on my project the following is sufficient:

    • id
    • title
    • start
    • end
    • allDay

    I think the ID only has to be unique for that instance of the JSON feed, so you could just have a counter incrementing in the server-side script that generates the JSON.

    Example output from the JSON script:

    [
        "0",
        {
            "allDay": "",
            "title": "Test event",
            "id": "821",
            "end": "2011-06-06 14:00:00",
            "start": "2011-06-06 06:00:00"
        },
        "1",
        {
            "allDay": "",
            "title": "Test event 2",
            "id": "822",
            "end": "2011-06-10 21:00:00",
            "start": "2011-06-10 16:00:00"
        }
    ]
    

提交回复
热议问题