maddhatter / laravel-fullcalendar

Laravel FullCalendar.io Helper
627 stars 267 forks source link

Multiple Resources for event inside array does not work #51

Open roulendz opened 8 years ago

roulendz commented 8 years ago

Inside FC docs there is option for events like Multiple Resources

events: [
        {
            id: '1',
            resourceIds: ['a', 'b'],
            title: 'Meeting',
            start: '2015-02-14'
        }
    ]

Full calendar Dods

So I can put one event in all resourcces using array and resource ID.

So I tried and it worked only if there is just one id inside array.

When I put two ID's inside array, event desipares.

       $events[] = \Calendar::event(
            'Event One', //event title
            false, //full day event?
            '2016-07-26T1100', //start time (you can also use Carbon instead of DateTime)
            '2016-07-26T1600', //end time (you can also use Carbon instead of DateTime)
            0,
            [
                'resourceId' => [1,2]
            ]
        );

        $events[] = \Calendar::event(
            "Valentine's Day", //event title
            true, //full day event?
            new \DateTime('2016-07-25T1300'), //start time (you can also use Carbon instead of DateTime)
            new \DateTime('2016-07-25T1600'), //end time (you can also use Carbon instead of DateTime)
            1,
            [
                'resourceId' => 1,
            ]
        );

Second event shows up, first does not show up :(

Could anybodey give me a hint?

joaoguilhermels commented 8 years ago

Just to confirm, are you using Fullcalendar Scheduler ? Because that is a premium add-on. If you are the problem might be because the first event is using strings as the start and end times.

SamehAtalla commented 5 years ago

@roulendz Hello, I am new with Laravel-fullcalendar, Could you give me an example for how you added 'Associating Events with Resources' with laravel especially add/assign 'resources' like this code below:
resources: [ { id: 'a', title: 'Room A' } ], events: [ { id: '1', resourceId: 'a', title: 'Meeting', start: '2015-02-14' } ] Regards.