Code Monkey home page Code Monkey logo

yii2-fullcalendar-scheduler's Introduction

Yii2 fullcalendar scheduler 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-scheduler "V1.1.12"

or add

"edofre/yii2-fullcalendar-scheduler": "V1.1.12"

to the require section of your composer.json file.

Usage

See the demos/ folder for all the examples.

Simple usage with array data

<?= \edofre\fullcalendarscheduler\FullcalendarScheduler::widget([
	'header'        => [
		'left'   => 'today prev,next',
		'center' => 'title',
		'right'  => 'timelineDay,timelineThreeDays,agendaWeek,month',
	],
	'clientOptions' => [
		'now'               => '2016-05-07',
		'editable'          => true, // enable draggable events
		'aspectRatio'       => 1.8,
		'scrollTime'        => '00:00', // undo default 6am scrollTime
		'defaultView'       => 'timelineDay',
		'views'             => [
			'timelineThreeDays' => [
				'type'     => 'timeline',
				'duration' => [
					'days' => 3,
				],
			],
		],
		'resourceLabelText' => 'Rooms',
		'resources'         => [
			['id' => 'a', 'title' => 'Auditorium A'],
			['id' => 'b', 'title' => 'Auditorium B', 'eventColor' => 'green'],
			['id' => 'c', 'title' => 'Auditorium C', 'eventColor' => 'orange'],
			[
				'id'       => 'd', 'title' => 'Auditorium D',
				'children' => [
					['id' => 'd1', 'title' => 'Room D1'],
					['id' => 'd2', 'title' => 'Room D2'],
				],
			],
			['id' => 'e', 'title' => 'Auditorium E'],
			['id' => 'f', 'title' => 'Auditorium F', 'eventColor' => 'red'],
			['id' => 'g', 'title' => 'Auditorium G'],
			['id' => 'h', 'title' => 'Auditorium H'],
			['id' => 'i', 'title' => 'Auditorium I'],
			['id' => 'j', 'title' => 'Auditorium J'],
			['id' => 'k', 'title' => 'Auditorium K'],
			['id' => 'l', 'title' => 'Auditorium L'],
			['id' => 'm', 'title' => 'Auditorium M'],
			['id' => 'n', 'title' => 'Auditorium N'],
			['id' => 'o', 'title' => 'Auditorium O'],
			['id' => 'p', 'title' => 'Auditorium P'],
			['id' => 'q', 'title' => 'Auditorium Q'],
			['id' => 'r', 'title' => 'Auditorium R'],
			['id' => 's', 'title' => 'Auditorium S'],
			['id' => 't', 'title' => 'Auditorium T'],
			['id' => 'u', 'title' => 'Auditorium U'],
			['id' => 'v', 'title' => 'Auditorium V'],
			['id' => 'w', 'title' => 'Auditorium W'],
			['id' => 'x', 'title' => 'Auditorium X'],
			['id' => 'y', 'title' => 'Auditorium Y'],
			['id' => 'z', 'title' => 'Auditorium Z'],
		],
		'events'            => [
			['id' => '1', 'resourceId' => 'b', 'start' => '2016-05-07T02:00:00', 'end' => '2016-05-07T07:00:00', 'title' => 'event 1'],
			['id' => '2', 'resourceId' => 'c', 'start' => '2016-05-07T05:00:00', 'end' => '2016-05-07T22:00:00', 'title' => 'event 2'],
			['id' => '3', 'resourceId' => 'd', 'start' => '2016-05-06', 'end' => '2016-05-08', 'title' => 'event 3'],
			['id' => '4', 'resourceId' => 'e', 'start' => '2016-05-07T03:00:00', 'end' => '2016-05-07T08:00:00', 'title' => 'event 4'],
			['id' => '5', 'resourceId' => 'f', 'start' => '2016-05-07T00:30:00', 'end' => '2016-05-07T02:30:00', 'title' => 'event 5'],
		],
	],
]);
?>

Simple use with JSON data from controller actions

<?= \edofre\fullcalendarscheduler\FullcalendarScheduler::widget([
	'header'        => [
		'left'   => 'today prev,next',
		'center' => 'title',
		'right'  => 'timelineDay,timelineThreeDays,agendaWeek,month',
	],
	'clientOptions' => [
		'now'               => '2016-05-07',
		'editable'          => true, // enable draggable events
		'aspectRatio'       => 1.8,
		'scrollTime'        => '00:00', // undo default 6am scrollTime
		'defaultView'       => 'timelineDay',
		'views'             => [
			'timelineThreeDays' => [
				'type'     => 'timeline',
				'duration' => ['days' => 3],
			],
		],
		'resourceLabelText' => 'Rooms',
		'resources'         => \yii\helpers\Url::to(['scheduler/resources', 'id' => 1]),
		'events'            => \yii\helpers\Url::to(['scheduler/events', 'id' => 2]),
	],
]);
?>

Controller actions (Controller is also included in the demos/json/ directory)

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

    return [
        new Resource(["id" => "a", "title" => "Auditorium A"]),
        new Resource(["id" => "b", "title" => "Auditorium B", "eventColor" => "green"]),
        new Resource(["id" => "c", "title" => "Auditorium C", "eventColor" => "orange"]),
        new Resource([
            "id" => "d", "title" => "Auditorium D", "children" => [
                new Resource(["id" => "d1", "title" => "Room D1"]),
                new Resource(["id" => "d2", "title" => "Room D2"]),
            ],
        ]),
        new Resource(["id" => "e", "title" => "Auditorium E"]),
        new Resource(["id" => "f", "title" => "Auditorium F", "eventColor" => "red"]),
        new Resource(["id" => "g", "title" => "Auditorium G"]),
        new Resource(["id" => "h", "title" => "Auditorium H"]),
        new Resource(["id" => "i", "title" => "Auditorium I"]),
        new Resource(["id" => "j", "title" => "Auditorium J"]),
        new Resource(["id" => "k", "title" => "Auditorium K"]),
        new Resource(["id" => "l", "title" => "Auditorium L"]),
        new Resource(["id" => "m", "title" => "Auditorium M"]),
        new Resource(["id" => "n", "title" => "Auditorium N"]),
        new Resource(["id" => "o", "title" => "Auditorium O"]),
        new Resource(["id" => "p", "title" => "Auditorium P"]),
        new Resource(["id" => "q", "title" => "Auditorium Q"]),
        new Resource(["id" => "r", "title" => "Auditorium R"]),
        new Resource(["id" => "s", "title" => "Auditorium S"]),
        new Resource(["id" => "t", "title" => "Auditorium T"]),
        new Resource(["id" => "u", "title" => "Auditorium U"]),
        new Resource(["id" => "v", "title" => "Auditorium V"]),
        new Resource(["id" => "w", "title" => "Auditorium W"]),
        new Resource(["id" => "x", "title" => "Auditorium X"]),
        new Resource(["id" => "y", "title" => "Auditorium Y"]),
        new Resource(["id" => "z", "title" => "Auditorium Z"]),
    ];
}

/**
 * @param $id
 * @param $start
 * @param $end
 * @return array
 */
public function actionEvents($id, $start, $end)
{
    \Yii::$app->response->format = \yii\web\Response::FORMAT_JSON;
    return [
        new Event(["id" => "1", "resourceId" => "b", "start" => "2016-05-07T02:00:00", "end" => "2016-05-07T07:00:00", "title" => "event 1"]),
        new Event(["id" => "2", "resourceId" => "c", "start" => "2016-05-07T05:00:00", "end" => "2016-05-07T22:00:00", "title" => "event 2"]),
        new Event(["id" => "3", "resourceId" => "d", "start" => "2016-05-06", "end" => "2016-05-08", "title" => "event 3"]),
        new Event(["id" => "4", "resourceId" => "e", "start" => "2016-05-07T03:00:00", "end" => "2016-05-07T08:00:00", "title" => "event 4"]),
        new Event(["id" => "5", "resourceId" => "f", "start" => "2016-05-07T00:30:00", "end" => "2016-05-07T02:30:00", "title" => "event 5"]),
    ];
}

yii2-fullcalendar-scheduler's People

Contributors

edofre avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

yii2-fullcalendar-scheduler's Issues

requires bower-asset/fullcalendar

I'm trying to install this extension, but I'm getting this error:

Problem 1
- edofre/yii2-fullcalendar-scheduler V1.1.1 requires bower-asset/fullcalendar v2.7.2 -> satisfiable by bower-asset/fullcalendar[v2.7.2].
- edofre/yii2-fullcalendar-scheduler dev-master requires bower-asset/fullcalendar v2.7.2 -> satisfiable by bower-asset/fullcalendar[v2.7.2].
- edofre/yii2-fullcalendar-scheduler 1.1.x-dev requires bower-asset/fullcalendar v2.7.2 -> satisfiable by bower-asset/fullcalendar[v2.7.2].
- edofre/yii2-fullcalendar-scheduler v1.1.0.x-dev requires bower-asset/fullcalendar v2.7.2 -> satisfiable by bower-asset/fullcalendar[v2.7.2].
- Conclusion: don't install bower-asset/fullcalendar v2.7.2
- Installation request for edofre/yii2-fullcalendar-scheduler @dev -> satisfiable by edofre/yii2-fullcalendar-scheduler[V1.1.1, dev-master, 1.1.x-dev, v1.1.0.x-dev].

Can anyone help me?

License

Hi,

How and where can I put the fullcalendar license?

thank you,
best regards,

Disable resizing

Hello, how can i disable resizing?
image
Perhaps there is a way to initially remove from the event the class "fc-resizable"

Install problem from composer

`composer require edofre/yii2-fullcalendar-scheduler "1.1.x-dev"
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.

Problem 1
- Installation request for edofre/yii2-fullcalendar-scheduler 1.1.x-dev -> satisfiable by edofre/yii2-fullcalendar-scheduler[1.1.x-dev].
- edofre/yii2-fullcalendar-scheduler 1.1.x-dev requires npm-asset/fullcalendar-scheduler 1.7.1 -> no matching package found.
`

locale-all.js not found after update

Hi !!

After run composer update, i have an error loading file locale-all.js.
I check assets and exist but into fullcalendar/dist directory.
console
composer_update

Tkanks a lot

Cannot remove License information

I tried the suggestion from fullCalendar official website, trying to remove the license key warning like follow:

$('#calendar').fullCalendar({
  schedulerLicenseKey: 'GPL-My-Project-Is-Open-Source'
});

However, the warning message still remains. Is there any way to remove it?

getEventResourceField Javascript error when move event

Hi again,

Thanks for your reply. Its work now, but with js error. I use "FullCalendar Scheduler v1.4.0" so when i move a event like screenshot attached i see this error.

I made a backup and before update its work with out js error. After update via composer.json
"edofre/yii2-fullcalendar-scheduler": "=1.1.4", generate this error.

I can send you the Yii code if you cant reproduce this error. I put "alert" on every event and dont show any alert to debug the error.

Thanks a lot,
javascript_error

Unable to get views to work

Hi,

I am unable to get any other view buttons to display other than the default for full-calendar-scheduler.
Only day,week,month,year displays.
The view does work if I set it as defaultView. I can't seems to figure out the reason why it doesn't work.

Yii Version 2.0.15.1
edofre/yii2-fullcalendar 1.0.11.0
edofre/yii2-fullcalendar-scheduler 1.1.12.0

            <?= \edofre\fullcalendarscheduler\FullcalendarScheduler::widget([
                  //'events'=> $events,
                  'clientOptions' => [
                        'schedulerLicenseKey' => 'GPL-My-Project-Is-Open-Source',
                        'weekNumbers' => true,
                        'selectable' => true,
                        'selectHelper' => true,
                        //'theme' =>true,
                        //'droppable' => true,
                        //'editable' => true,
                        'nowIndicator' => true,
                        'navLinks' => true,
                        'slotDuration' => '01:00:00',

                        //'drop' => new JsExpression($JSDropEvent),
                        'select' => new JsExpression($JSCode),
                        'eventClick' => new JsExpression($JSEventClick),
                        //'eventMouseover' => new JsExpression($JSEventHover),
                        //'eventRender' => new JsExpression($js),
                        //'eventRender' => new JsExpression($JSEventRender),

                        //'defaultDate' => date('Y-m-d'),
                        //'defaultDate' => date('2019-01-01'),
                        //'gotoDate' => date('2019-01-01'),
                        //'businessHours' => ['start'=> '07:30', 'end'=> '16:30'],
                        'header'        => [
                                'left'   => 'prev,next today',
                                'center' => 'title',
                                'right'  => 'agendaDay,agendaTwoDay,agendaWeek,month',
                        ],
                        //'defaultView'       => 'timelineDay',
                        'defaultView'       => 'agendaDay',
                        'views'       => [
                                'agendaTwoDay' => [
                                        'type'            => 'agenda',
                                        'duration'        => ['days' => 2],
                                        // views that are more than a day will NOT do this behavior by default
                                        // so, we need to explicitly enable it
                                        'groupByResource' => true,
                                        //// uncomment this line to group by day FIRST with resources underneath
                                        //'groupByDateAndResource'=>true,
                                ],
                        ],            

                        //'editable'          => true, // enable draggable events
                        'aspectRatio'       => 2.8,
                        'scrollTime'        => '00:00', // undo default 6am scrollTime
                        'resourceLabelText' => 'Rooms',
                        'resourceAreaWidth' => '10%',
                        'resources'   => Url::to(['cal-event/json-resources', 'id' => 1]),
                        'events'      => Url::to(['/cal-event/jsoncalendar']),
                        //'listWeek' => true

                  ],
                ]);
            ?>    

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.