All Projects → Edofre → yii2-fullcalendar

Edofre / yii2-fullcalendar

Licence: MIT License
Yii 2 component for easy fullcalendar integration

Programming Languages

PHP
23972 projects - #3 most used programming language

Projects that are alternatives of or similar to yii2-fullcalendar

yii2-fullcalendar-scheduler
Yii 2 component for easy fullcalendar scheduler integration
Stars: ✭ 24 (+14.29%)
Mutual labels:  packagist, yii2, calendar, fullcalendar
svelte-fullcalendar
A Svelte component wrapper around FullCalendar
Stars: ✭ 123 (+485.71%)
Mutual labels:  calendar, fullcalendar
Yii2fullcalendar
JQuery Fullcalendar Yii2 Extension
Stars: ✭ 120 (+471.43%)
Mutual labels:  yii2, calendar
Tui.calendar
🍞📅A JavaScript calendar that has everything you need.
Stars: ✭ 9,537 (+45314.29%)
Mutual labels:  calendar, fullcalendar
Yii2 Tech
Yii2 通用后台管理系统
Stars: ✭ 193 (+819.05%)
Mutual labels:  yii2, calendar
laravel-fullcalendar
Laravel Fullcalendar component
Stars: ✭ 57 (+171.43%)
Mutual labels:  calendar, fullcalendar
calendar-view-plugin
Jenkins Calendar View Plugin: Shows past and future builds in a calendar view
Stars: ✭ 17 (-19.05%)
Mutual labels:  calendar, fullcalendar
yii2-multi-select-widget
Bootstrap MultiSelect and MultiSelect Listbox widgets for Yii2
Stars: ✭ 45 (+114.29%)
Mutual labels:  yii2
contao-events subscriptions
Contao extension that allows members of your website to subscribe to the events
Stars: ✭ 12 (-42.86%)
Mutual labels:  calendar
yii2-ratelimiter-advanced
Advanced Rate Limiter is a Yii2 filter to enforce or monitor request rate limits.
Stars: ✭ 23 (+9.52%)
Mutual labels:  yii2
calendar-link
📅 Calendar link generator for popular services
Stars: ✭ 193 (+819.05%)
Mutual labels:  calendar
yii2-material-theme
Material Theme for Yii2
Stars: ✭ 15 (-28.57%)
Mutual labels:  yii2
groupoffice
Group Office groupware and CRM
Stars: ✭ 80 (+280.95%)
Mutual labels:  calendar
yii2-starter-kit-lite
Yii2 Starter kit for begin your application
Stars: ✭ 41 (+95.24%)
Mutual labels:  yii2
collection
Basic collection library for Yii Framework 2.0
Stars: ✭ 29 (+38.1%)
Mutual labels:  yii2
rc-year-calendar
Official React wrapper for the year-calendar widget
Stars: ✭ 27 (+28.57%)
Mutual labels:  calendar
react-activity-calendar
A React component to display activity data in a calendar (heatmap)
Stars: ✭ 69 (+228.57%)
Mutual labels:  calendar
yii2-dropzone
This extension provides the Dropzone integration for the Yii2 framework.
Stars: ✭ 11 (-47.62%)
Mutual labels:  yii2
Calendar
A calendar picker component, based on jQuery.
Stars: ✭ 49 (+133.33%)
Mutual labels:  calendar
summit-app-ios
The official app for the OpenStack Summit
Stars: ✭ 35 (+66.67%)
Mutual labels:  calendar

Yii2 fullcalendar component

Latest Stable Version Total Downloads Latest Unstable Version License composer.lock

Installation

The preferred way to install this extension is through composer.

To install, either run

$ php composer.phar require edofre/yii2-fullcalendar "V1.0.11"

or add

"edofre/yii2-fullcalendar": "V1.0.11"

to the require section of your composer.json file.

Usage

Fullcalendar can be created as following, all options are optional, below is just an example of most options

<?= edofre\fullcalendar\Fullcalendar::widget([
        'options'       => [
            'id'       => 'calendar',
            'language' => 'nl',
        ],
        'clientOptions' => [
            'weekNumbers' => true,
            'selectable'  => true,
            'defaultView' => 'agendaWeek',
            'eventResize' => new JsExpression("
                function(event, delta, revertFunc, jsEvent, ui, view) {
                    console.log(event);
                }
            "),

        ],
        'events'        => Url::to(['calendar/events', 'id' => $uniqid]),
    ]);
?>

Events can be added in three ways, PHP array, Javascript array or JSON feed

PHP array

<?php
    $events = [
        new Event([
            'title' => 'Appointment #' . rand(1, 999),
            'start' => '2016-03-18T14:00:00',
        ]),
        // Everything editable
        new Event([
            'id'               => uniqid(),
            'title'            => 'Appointment #' . rand(1, 999),
            'start'            => '2016-03-17T12:30:00',
            'end'              => '2016-03-17T13:30:00',
            'editable'         => true,
            'startEditable'    => true,
            'durationEditable' => true,
        ]),
        // No overlap
        new Event([
            'id'               => uniqid(),
            'title'            => 'Appointment #' . rand(1, 999),
            'start'            => '2016-03-17T15:30:00',
            'end'              => '2016-03-17T19:30:00',
            'overlap'          => false, // Overlap is default true
            'editable'         => true,
            'startEditable'    => true,
            'durationEditable' => true,
        ]),
        // Only duration editable
        new Event([
            'id'               => uniqid(),
            'title'            => 'Appointment #' . rand(1, 999),
            'start'            => '2016-03-16T11:00:00',
            'end'              => '2016-03-16T11:30:00',
            'startEditable'    => false,
            'durationEditable' => true,
        ]),
        // Only start editable
        new Event([
            'id'               => uniqid(),
            'title'            => 'Appointment #' . rand(1, 999),
            'start'            => '2016-03-15T14:00:00',
            'end'              => '2016-03-15T15:30:00',
            'startEditable'    => true,
            'durationEditable' => false,
        ]),
    ];
?>

<?= edofre\fullcalendar\Fullcalendar::widget([
        'events'        => $events
    ]);
?>

Javascript array

<?= edofre\fullcalendar\Fullcalendar::widget([
       'events'        => new JsExpression('[
            {
                "id":null,
                "title":"Appointment #776",
                "allDay":false,
                "start":"2016-03-18T14:00:00",
                "end":null,
                "url":null,
                "className":null,
                "editable":false,
                "startEditable":false,
                "durationEditable":false,
                "rendering":null,
                "overlap":true,
                "constraint":null,
                "source":null,
                "color":null,
                "backgroundColor":"grey",
                "borderColor":"black",
                "textColor":null
            },
            {
                "id":"56e74da126014",
                "title":"Appointment #928",
                "allDay":false,
                "start":"2016-03-17T12:30:00",
                "end":"2016-03-17T13:30:00",
                "url":null,
                "className":null,
                "editable":true,
                "startEditable":true,
                "durationEditable":true,
                "rendering":null,
                "overlap":true,
                "constraint":null,
                "source":null,
                "color":null,
                "backgroundColor":"grey",
                "borderColor":"black",
                "textColor":null
            },
            {
                "id":"56e74da126050",
                "title":"Appointment #197",
                "allDay":false,
                "start":"2016-03-17T15:30:00",
                "end":"2016-03-17T19:30:00",
                "url":null,
                "className":null,
                "editable":true,
                "startEditable":true,
                "durationEditable":true,
                "rendering":null,
                "overlap":false,
                "constraint":null,
                "source":null,
                "color":null,
                "backgroundColor":"grey",
                "borderColor":"black",
                "textColor":null
            },
            {
                "id":"56e74da126080",
                "title":"Appointment #537",
                "allDay":false,
                "start":"2016-03-16T11:00:00",
                "end":"2016-03-16T11:30:00",
                "url":null,
                "className":null,
                "editable":false,
                "startEditable":false,
                "durationEditable":true,
                "rendering":null,
                "overlap":true,
                "constraint":null,
                "source":null,
                "color":null,
                "backgroundColor":"grey",
                "borderColor":"black",
                "textColor":null
            },
            {
                "id":"56e74da1260a7",
                "title":"Appointment #465",
                "allDay":false,
                "start":"2016-03-15T14:00:00",
                "end":"2016-03-15T15:30:00",
                "url":null,
                "className":null,
                "editable":false,
                "startEditable":true,
                "durationEditable":false,
                "rendering":null,
                "overlap":true,
                "constraint":null,
                "source":null,
                "color":null,
                "backgroundColor":"grey",
                "borderColor":"black",
                "textColor":null
            },
        ]'),
    ]);
?>

JSON feed

<?= edofre\fullcalendar\Fullcalendar::widget([
        'events'        => Url::to(['calendar/events', 'id' => $uniqid]),
    ]);
?>

Your controller action would then return an array as following

    /**
	 * @param $id
	 * @param $start
	 * @param $end
	 * @return array
	 */
	public function actionEvents($id, $start, $end)
	{
		\Yii::$app->response->format = \yii\web\Response::FORMAT_JSON;

		return [
			// minimum
			new Event([
				'title' => 'Appointment #' . rand(1, 999),
				'start' => '2016-03-18T14:00:00',
			]),
			// Everything editable
			new Event([
				'id'               => uniqid(),
				'title'            => 'Appointment #' . rand(1, 999),
				'start'            => '2016-03-17T12:30:00',
				'end'              => '2016-03-17T13:30:00',
				'editable'         => true,
				'startEditable'    => true,
				'durationEditable' => true,
			]),
			// No overlap
			new Event([
				'id'               => uniqid(),
				'title'            => 'Appointment #' . rand(1, 999),
				'start'            => '2016-03-17T15:30:00',
				'end'              => '2016-03-17T19:30:00',
				'overlap'          => false, // Overlap is default true
				'editable'         => true,
				'startEditable'    => true,
				'durationEditable' => true,
			]),
			// Only duration editable
			new Event([
				'id'               => uniqid(),
				'title'            => 'Appointment #' . rand(1, 999),
				'start'            => '2016-03-16T11:00:00',
				'end'              => '2016-03-16T11:30:00',
				'startEditable'    => false,
				'durationEditable' => true,
			]),
			// Only start editable
			new Event([
				'id'               => uniqid(),
				'title'            => 'Appointment #' . rand(1, 999),
				'start'            => '2016-03-15T14:00:00',
				'end'              => '2016-03-15T15:30:00',
				'startEditable'    => true,
				'durationEditable' => false,
			]),
		];
	}

Callbacks

Callbacks have to be wrapped in a JsExpression() object. For example if you want to use the eventResize you would add the following to the fullcalendar clientOptions

<?= edofre\fullcalendar\Fullcalendar::widget([
        'clientOptions' => [
            'eventResize' => new JsExpression("
                function(event, delta, revertFunc, jsEvent, ui, view) {
                    console.log(event.id);
                    console.log(delta);
                }
            "),
        ],
    ]);
?>
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].