0

Regarding this and this Question, Id like to know, if this can be redone with a working solution on fiddle? Seems like theres no such things as 'isMultipleDay' or 'multipleDayEvents'.

$('#calendar').fullCalendar ({
    defaultView:'month', 
    defaultDate: '2014-11-20', 
    timezone: 'local',
    events: [ {
        title: "Birmingham Comic Con",
        start: new Date('2014-11-20T09:00'),
        end: new Date('2014-11-22T19:00'),
        id: 1, 
        isMultipleDay: true, 
        multipleDayEvents: [{
            start: new Date('2014-11-12T09:00'), 
            end: new Date('2014-11-15T19:00'), 
            description: 'Day 1'
            }, 
            {
            start: new Date('2014-11-16T09:00'),
            end: new Date('2014-11-18T19:00'),
            description: 'Day 2'
            }, 
            {
            start: new Date('2014-11-02T09:00'),
            end: new Date('2014-11-05T19:00'),
            description: 'Day 3'
            }
        ]
     }]
   })

function AddEvent(){
   $('#calendar').fullCalendar('renderEvent', ourEvent, true);
}

http://jsfiddle.net/duu0dx2t/1035/

hes
  • 121
  • 2
  • 14
  • You're right, those properties are non-standard, and not recognised by default in fullCalendar. In this answer from one of your links: https://stackoverflow.com/a/27275963/5947043 it describes some of the custom code you'd need to write in order to make use of this bespoke data structure. Have you understood that, and tried to create it? Alternatively, there's also this: https://stackoverflow.com/questions/15161654/recurring-events-in-fullcalendar which is another example of a customisation to allow recurring events, using a slightly different data structure, but following a similar principle. – ADyson Aug 23 '17 at 08:58
  • I know theres the possibility to use recurring events, but this doesnt suit my needs. Thats why I tried to rebuild this "solution": https://stackoverflow.com/questions/40135126/fullcalendar-list-view-multi-day-events-not-grouping-correctly/45827133?noredirect=1#comment78612383_45827133 ..which also referres to this question: https://stackoverflow.com/questions/27273096/fullcalendar-multi-day-event-start-and-end-times/27275963#27275963. But unfortunately I the code from there doesnt work at all. – hes Aug 23 '17 at 10:46
  • The code from those questions? There isn't any code, just a data structure. Like I said above, if you want to use that data structure, _you_ have to write the code to interpret it and turn it into something compatible with fullCalendar. But...if you don't want recurring events, as you say, then why do you need this at all? What's your goal? The entire point of this data structure you're referring to is to support recurring events. The link I gave is just a different way of structuring it. And it contains code that actually works already. – ADyson Aug 23 '17 at 11:31
  • Ok. I see. Well, Im not able to write such a "complex" code. I need recurring events, but not the way they are structured with 'dow'. So an Event could be on a Monday 26 in March, Thursday 24 in June and Friday 12 in August. – hes Aug 23 '17 at 12:44
  • Ok so you need some more flexibility by the sound of it. The best place to start from would be your database, rather than someone else's abritrary suggestion. How do you hold this recurrence information in your database currently? From that structure, you can presumably derive a series of individual events which can be displayed, representing the result of the recurrence. What's your server-side language? It might be turn out to be easier to write that logic on the server and just pass to fullCalendar the expanded list of individual events. You can use custom fields to link them together maybe – ADyson Aug 23 '17 at 13:21
  • Im using Wordpress with Advanced Custom Fields. So my first thought was to find a json structure that works and to form my query afterwards. Maybe I should duplicate those events with multiple dates. Overall it seems like a unique question since I could'nt find anything about it. – hes Aug 23 '17 at 13:58
  • I think that's the wrong way round to approach it. You're actually introducing an unnecessary intermediary step (your database structure -> some random JSON structure you found online -> fullCalendar-supported JSON structure). The simplest approach is to go direct: (your database structure -> fullCalendar-supported JSON structure). The fact it's a Wordpress thing doesn't seem all that relevant to me, you still have a database structure to represent the recurrence, I presume. – ADyson Aug 23 '17 at 14:05
  • So yeah, use that to write PHP code to output a series of individual events which fullCalendar understands. Recurring events might get "duplicated" in the JSON version (but remember in fullCalendar's language, if they have different dates/times, they aren't duplicates), in order to produce a compatible data stream. If you need some interaction with those in the UI which might involve sending things back to the DB (e.g. update event), you'll have to put some extra field(s) into the event objects to represent the database object(s) they were derived from etc. – ADyson Aug 23 '17 at 14:07

1 Answers1

-1

Thanks for your support ADyson. Ive build my own repeater and duplicated those events with several dates and it works as desired :)

hes
  • 121
  • 2
  • 14