全日历-分别显示范围事件

时间:2019-04-19 10:11:11

标签: javascript jquery laravel fullcalendar

我正在使用fullCalendar 3.10,我遇到了如下事件:

        $event_list[] = Calendar::event(
            $event->name,
            false,
            new \DateTime($event->start_date.' '.$event->start_time),
            new \DateTime($event->end_date.' '.$event->end_time),
            $event->id,
            [
                'color' => '#f05050',
                'slug' => $event->slug,
                'url' => 'event/'.$event->slug,
            ]
        );

现在让我们说一个事件在日期范围01.04.2019到04.04.2019中,如何在月视图中将其显示为单个事件块,而不是拉伸事件块?谢谢

1 个答案:

答案 0 :(得分:0)

我为您找到了一个简单的解决方案:

$event_list[] = Calendar::event(
            $event->name,
            false,
            new \DateTime($event->start_date.' '.$event->start_time),
            new \DateTime($event->end_date.' '.$event->end_time),
            rendering: 'background',
            backgroundColor = '#f05050',
            $event->id,
            [
               // 'color' => '#f05050',
                'slug' => $event->slug,
                'url' => 'event/'.$event->slug,
            ]
        );