예제 #1
0
<?php

echo \edofre\fullcalendarscheduler\FullcalendarScheduler::widget(['header' => ['left' => 'today prev,next', 'center' => 'title', 'right' => 'timelineDay,timelineThreeDays,agendaWeek,month'], 'clientOptions' => ['now' => '2016-05-07', 'editable' => true, 'aspectRatio' => 1.8, 'scrollTime' => '00:00', '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']]]]);
<?php

echo \edofre\fullcalendarscheduler\FullcalendarScheduler::widget(['header' => ['left' => 'today prev,next', 'center' => 'title', 'right' => 'timelineDay,timelineThreeDays,agendaWeek,month'], 'clientOptions' => ['now' => '2016-05-07', 'editable' => true, 'aspectRatio' => 1.8, 'scrollTime' => '00:00', 'defaultView' => 'timelineDay', 'views' => ['timelineThreeDays' => ['type' => 'timeline', 'duration' => ['days' => 3]]], 'resourceLabelText' => 'Rooms', 'resourceText' => new \yii\web\JsExpression("\n\t\t\tfunction(resource) {\n\t\t\t\treturn 'Auditorium ' + ('' + resource.id).toUpperCase();\n\t\t\t}\n\t\t"), 'resourceRender' => new \yii\web\JsExpression("\n\t\t\tfunction(resource, leftCells, rightCells) {\n\t\t\t\tif (resource.id == 'h') {\n\t\t\t\t\tleftCells.css('background-color', 'rgb(255, 243, 206)');\n\t\t\t\t\trightCells.css('background-color', 'rgba(255, 243, 206, .5)');\n\t\t\t\t}\n\t\t\t}\n\t\t"), 'resources' => [['id' => 'a'], ['id' => 'b', 'eventColor' => 'green'], ['id' => 'c', 'eventColor' => 'orange'], ['id' => 'd'], ['id' => 'e'], ['id' => 'f', 'eventColor' => 'red'], ['id' => 'g'], ['id' => 'h'], ['id' => 'i'], ['id' => 'j'], ['id' => 'k'], ['id' => 'l'], ['id' => 'm'], ['id' => 'n'], ['id' => 'o'], ['id' => 'p'], ['id' => 'q'], ['id' => 'r'], ['id' => 's'], ['id' => 't'], ['id' => 'u'], ['id' => 'v'], ['id' => 'w'], ['id' => 'x'], ['id' => 'y'], ['id' => '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']]]]);
<?php

/**
 * IMPORTANT
 *
 * For the draggables to work make sure you include the 'yii\jui\JuiAsset' asset to your AppAsset depends configuration
 *
 * IMPORTANT
 */
$this->registerJs("\r\n\t/* initialize the external events\r\n\t-----------------------------------------------------------------*/\r\n\t\$('#external-events .fc-event').each(function() {\r\n\r\n\t\t// store data so the calendar knows to render an event upon drop\r\n\t\t\$(this).data('event', {\r\n\t\t\ttitle: \$.trim(\$(this).text()), // use the element's text as the event title\r\n\t\t\tstick: true // maintain when user navigates (see docs on the renderEvent method)\r\n\t\t});\r\n\r\n\t\t// make the event draggable using jQuery UI\r\n\t\t\$(this).draggable({\r\n\t\t\tzIndex: 999,\r\n\t\t\trevert: true,      // will cause the event to go back to its\r\n\t\t\trevertDuration: 0  //  original position after the drag\r\n\t\t});\r\n\t});\r\n", \yii\web\View::POS_END);
?>

<?php 
echo \edofre\fullcalendarscheduler\FullcalendarScheduler::widget(['clientOptions' => ['now' => '2016-05-07', 'editable' => true, 'droppable' => true, 'aspectRatio' => 1.8, 'scrollTime' => '00:00', 'header' => ['left' => 'today prev,next', 'center' => 'title', 'right' => 'timelineDay,timelineThreeDays,agendaWeek,month'], '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']], 'drop' => new \yii\web\JsExpression("\r\n\t\t\tfunction(date, jsEvent, ui, resourceId) {\r\n\t\t\t\tconsole.log('drop', date.format(), resourceId);\r\n\r\n\t\t\t\t// is the \"remove after drop\" checkbox checked?\r\n\t\t\t\tif (\$('#drop-remove').is(':checked')) {\r\n\t\t\t\t\t// if so, remove the element from the \"Draggable Events\" list\r\n\t\t\t\t\t\$(this).remove();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t"), 'eventReceive' => new \yii\web\JsExpression("\r\n\t\t\tfunction(event) { // called when a proper external event is dropped\r\n\t\t\t\tconsole.log('eventReceive', event);\r\n\t\t\t}\r\n\t\t"), 'eventDrop' => new \yii\web\JsExpression("\r\n\t\t\tfunction(event) { // called when an event (already on the calendar) is moved\r\n\t\t\t\tconsole.log('eventDrop', event);\r\n\t\t\t}\r\n\t\t")]]);
$this->registerCss('
	body {
		margin-top: 40px;
		text-align: center;
		font-size: 14px;
		font-family: "Lucida Grande",Helvetica,Arial,Verdana,sans-serif;
	}

	#wrap {
		width: 1100px;
		margin: 0 auto;
	}

	#external-events {
		float: left;
		width: 150px;
		padding: 0 10px;
<?php

echo \edofre\fullcalendarscheduler\FullcalendarScheduler::widget(['clientOptions' => ['now' => '2016-05-07', 'editable' => true, 'aspectRatio' => 1.8, 'scrollTime' => '00:00', 'header' => ['left' => 'today prev,next', 'center' => 'title', 'right' => 'timelineDay,timelineThreeDays,agendaWeek,month'], 'defaultView' => 'timelineDay', 'views' => ['timelineThreeDays' => ['type' => 'timeline', 'duration' => ['days' => 3]]], 'resourceLabelText' => 'Rooms', 'resourceAreaWidth' => '40%', 'resourceColumns' => [['group' => true, 'labelText' => 'Building', 'field' => 'building'], ['labelText' => 'Room', 'field' => 'title'], ['labelText' => 'Occupancy', 'field' => 'occupancy']], 'resources' => [['id' => 'a', 'building' => '460 Bryant', 'title' => 'Auditorium A', 'occupancy' => 40], ['id' => 'b', 'building' => '460 Bryant', 'title' => 'Auditorium B', 'occupancy' => 40, 'eventColor' => 'green'], ['id' => 'c', 'building' => '460 Bryant', 'title' => 'Auditorium C', 'occupancy' => 40, 'eventColor' => 'orange'], ['id' => 'd', 'building' => '460 Bryant', 'title' => 'Auditorium D', 'occupancy' => 40, 'children' => [['id' => 'd1', 'title' => 'Room D1', 'occupancy' => 10], ['id' => 'd2', 'title' => 'Room D2', 'occupancy' => 10]]], ['id' => 'e', 'building' => '460 Bryant', 'title' => 'Auditorium E', 'occupancy' => 40], ['id' => 'f', 'building' => '460 Bryant', 'title' => 'Auditorium F', 'occupancy' => 40, 'eventColor' => 'red'], ['id' => 'g', 'building' => '564 Pacific', 'title' => 'Auditorium G', 'occupancy' => 40], ['id' => 'h', 'building' => '564 Pacific', 'title' => 'Auditorium H', 'occupancy' => 40], ['id' => 'i', 'building' => '564 Pacific', 'title' => 'Auditorium I', 'occupancy' => 40], ['id' => 'j', 'building' => '564 Pacific', 'title' => 'Auditorium J', 'occupancy' => 40], ['id' => 'k', 'building' => '564 Pacific', 'title' => 'Auditorium K', 'occupancy' => 40], ['id' => 'l', 'building' => '564 Pacific', 'title' => 'Auditorium L', 'occupancy' => 40], ['id' => 'm', 'building' => '564 Pacific', 'title' => 'Auditorium M', 'occupancy' => 40], ['id' => 'n', 'building' => '564 Pacific', 'title' => 'Auditorium N', 'occupancy' => 40], ['id' => 'o', 'building' => '564 Pacific', 'title' => 'Auditorium O', 'occupancy' => 40], ['id' => 'p', 'building' => '564 Pacific', 'title' => 'Auditorium P', 'occupancy' => 40], ['id' => 'q', 'building' => '564 Pacific', 'title' => 'Auditorium Q', 'occupancy' => 40], ['id' => 'r', 'building' => '564 Pacific', 'title' => 'Auditorium R', 'occupancy' => 40], ['id' => 's', 'building' => '564 Pacific', 'title' => 'Auditorium S', 'occupancy' => 40], ['id' => 't', 'building' => '564 Pacific', 'title' => 'Auditorium T', 'occupancy' => 40], ['id' => 'u', 'building' => '564 Pacific', 'title' => 'Auditorium U', 'occupancy' => 40], ['id' => 'v', 'building' => '564 Pacific', 'title' => 'Auditorium V', 'occupancy' => 40], ['id' => 'w', 'building' => '564 Pacific', 'title' => 'Auditorium W', 'occupancy' => 40], ['id' => 'x', 'building' => '564 Pacific', 'title' => 'Auditorium X', 'occupancy' => 40], ['id' => 'y', 'building' => '564 Pacific', 'title' => 'Auditorium Y', 'occupancy' => 40], ['id' => 'z', 'building' => '564 Pacific', 'title' => 'Auditorium Z', 'occupancy' => 40]], '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']]]]);
예제 #5
0
<?php

echo \edofre\fullcalendarscheduler\FullcalendarScheduler::widget(['clientOptions' => ['now' => '2016-05-07', 'editable' => true, 'aspectRatio' => 1.8, 'scrollTime' => '00:00', 'header' => ['left' => 'today prev,next', 'center' => 'title', 'right' => 'timelineMonth,timelineYear'], 'defaultView' => 'timelineMonth', 'googleCalendarApiKey' => 'AIzaSyDcnW6WejpTOCffshGDDb4neIrXVUA1EAE', 'events' => '*****@*****.**', 'dayClick' => new \yii\web\JsExpression("\n\t\t\t\tfunction (event) {\n\t\t\t\t\t// opens events in a popup window\n\t\t\t\t\twindow.open(event.url, 'gcalevent', 'width=700,height=600');\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t")]]);
<?php

echo \edofre\fullcalendarscheduler\FullcalendarScheduler::widget(['header' => ['left' => 'prev,next today', 'center' => 'title', 'right' => 'agendaDay,agendaTwoDay,agendaWeek,month'], 'clientOptions' => ['defaultView' => 'agendaDay', 'defaultDate' => '2016-05-07', 'editable' => true, 'selectable' => true, 'eventLimit' => true, 'views' => ['agendaTwoDay' => ['type' => 'agenda', 'duration' => ['days' => 2], 'groupByResource' => true]], 'resources' => [['id' => 'a', 'title' => 'Room A'], ['id' => 'b', 'title' => 'Room B', 'eventColor' => 'green'], ['id' => 'c', 'title' => 'Room C', 'eventColor' => 'orange'], ['id' => 'd', 'title' => 'Room D', 'eventColor' => 'red']], 'events' => [['id' => '1', 'resourceId' => 'a', 'start' => '2016-05-06', 'end' => '2016-05-08', 'title' => 'event 1'], ['id' => '2', 'resourceId' => 'a', 'start' => '2016-05-07T09:00:00', 'end' => '2016-05-07T14:00:00', 'title' => 'event 2'], ['id' => '3', 'resourceId' => 'b', 'start' => '2016-05-07T12:00:00', 'end' => '2016-05-08T06:00:00', 'title' => 'event 3'], ['id' => '4', 'resourceId' => 'c', 'start' => '2016-05-07T07:30:00', 'end' => '2016-05-07T09:30:00', 'title' => 'event 4'], ['id' => '5', 'resourceId' => 'd', 'start' => '2016-05-07T10:00:00', 'end' => '2016-05-07T15:00:00', 'title' => 'event 5']], 'select' => new \yii\web\JsExpression("\n\t\t\tfunction(start, end, jsEvent, view, resource) {\n\t\t\t\tconsole.log(\n\t\t\t\t\t'select',\n\t\t\t\t\tstart.format(),\n\t\t\t\t\tend.format(),\n\t\t\t\t\tresource ? resource.id : '(no resource)'\n\t\t\t\t);\n\t\t\t}\n\t\t"), 'dayClick' => new \yii\web\JsExpression("\n\t\t\tfunction(date, jsEvent, view, resource) {\n\t\t\t\tconsole.log(\n\t\t\t\t\t'dayClick',\n\t\t\t\t\tdate.format(),\n\t\t\t\t\tresource ? resource.id : '(no resource)'\n\t\t\t\t);\n\t\t\t}\n\t\t")]]);
<?php

echo \edofre\fullcalendarscheduler\FullcalendarScheduler::widget(['header' => ['left' => 'promptResource today prev,next', 'center' => 'title', 'right' => 'timelineDay,timelineThreeDays,agendaWeek,month'], 'clientOptions' => ['selectable' => true, 'selectHelper' => true, 'now' => '2016-05-07', 'editable' => true, 'aspectRatio' => 1.8, 'scrollTime' => '00:00', 'defaultView' => 'timelineDay', 'views' => ['timelineThreeDays' => ['type' => 'timeline', 'duration' => ['days' => 3]]], 'customButtons' => ['promptResource' => ['text' => '+ room', 'click' => new \yii\web\JsExpression("\n\t\t\t\t\t\tfunction() {\n\t\t\t\t\t\t\tvar title = prompt('Room name');\n\t\t\t\t\t\t\tif (title) {\n\t\t\t\t\t\t\t\t\$('#calendar').fullCalendar(\n\t\t\t\t\t\t\t\t   'addResource',\n\t\t\t\t\t\t\t\t\t{ title: title },\n\t\t\t\t\t\t\t\t\ttrue // scroll to the new resource?\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t")]], 'resourceLabelText' => 'Rooms', 'resourceRender' => new \yii\web\JsExpression("\n\t\t\t\tfunction(resource, cellEls) {\n\t\t\t\t\tcellEls.on('click', function() {\n\t\t\t\t\t\tif (confirm('Are you sure you want to delete ' + resource.title + '?')) {\n\t\t\t\t\t\t\t\$('#calendar').fullCalendar('removeResource', resource);\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t"), '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']]]]);
$this->registerCss('
	body {
		margin: 0;
		padding: 0;
		font-family: "Lucida Grande",Helvetica,Arial,Verdana,sans-serif;
		font-size: 14px;
	}

	p {
		text-align: center;
	}

	#calendar {
		max-width: 900px;
		margin: 50px auto;
	}

	.fc-resource-area td {
		cursor: pointer;
	}
');
?>
<p>
	HINT: click on a resource to delete it.
</p>
<?php

echo \edofre\fullcalendarscheduler\FullcalendarScheduler::widget(['header' => ['left' => 'today prev,next', 'center' => 'title', 'right' => 'timelineDay,timelineThreeDays,agendaWeek,month'], 'clientOptions' => ['selectable' => true, 'selectHelper' => true, 'now' => '2016-05-07', 'editable' => true, 'aspectRatio' => 1.8, 'scrollTime' => '00:00', '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']], 'select' => new \yii\web\JsExpression("\n\t\t\tfunction(start, end, jsEvent, view, resource) {\n\t\t\t\tconsole.log(\n\t\t\t\t\t'select callback',\n\t\t\t\t\tstart.format(),\n\t\t\t\t\tend.format(),\n\t\t\t\t\tresource ? resource.id : '(no resource)'\n\t\t\t\t);\n\t\t\t}\n\t\t"), 'dayClick' => new \yii\web\JsExpression("\n\t\t\tfunction(date, jsEvent, view, resource) {\n\t\t\t\tconsole.log(\n\t\t\t\t\t'dayClick',\n\t\t\t\t\tdate.format(),\n\t\t\t\t\tresource ? resource.id : '(no resource)'\n\t\t\t\t);\n\t\t\t}\n\t\t")]]);
?>

<?php 
$this->registerJs("\n\$('#select-G').on('click', function() {\n\t\$('#calendar').fullCalendar('select', '2016-05-07T02:00:00', '2016-05-07T07:00:00', 'g');\n});\n\n\$('#select-unspecified').on('click', function() {\n\t\$('#calendar').fullCalendar('select', '2016-05-07T02:00:00', '2016-05-07T07:00:00');\n});\n");
?>

<p style='text-align:center'>
	<button id='select-G'>select G</button>
	<button id='select-unspecified'>select w/o a resource</button>
</p>
예제 #9
0
<?php

echo \edofre\fullcalendarscheduler\FullcalendarScheduler::widget(['header' => ['left' => 'today prev,next', 'center' => 'title', 'right' => 'timelineDay,timelineThreeDays,agendaWeek,month'], 'clientOptions' => ['now' => '2016-05-07', 'editable' => true, 'aspectRatio' => 1.8, 'scrollTime' => '00:00', '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])]]);