我用这段代码创建了一个事件:
<?php
use yii\helpers\Url;
$events = array();
//Testing
$Event = new \yii2fullcalendar\models\Event();
$Event->id = 1;
$Event->title = 'milad';
$Event->editable=TRUE;
$Event->start = date('Y-m-d\TH:i:s\Z');
$events[] = $Event;
$Event = new \yii2fullcalendar\models\Event();
$Event->id = 2;
$Event->title = 'Testing';
$Event->start = date('Y-m-d\TH:i:s\Z',strtotime('tomorrow 6am'));
$events[] = $Event;
?>
<?= \yii2fullcalendar\yii2fullcalendar::widget(array(
'events'=> $events,
));
?>
<?= yii2fullcalendar\yii2fullcalendar::widget([
'options' => [
'lang' => 'fa',
//... more options to be defined here!
],
'ajaxEvents' => Url::to(['/timetrack/default/jsoncalendar'])
]);
?>
如何为事件添加Drag-n-drop! 我找不到这个工作的好文档! 这是全日历的延伸: