如何在yii2中的fullcalendar中添加事件

时间:2016-06-25 09:55:24

标签: jquery yii2 fullcalendar

我用这段代码创建了一个事件:

<?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! 我找不到这个工作的好文档! 这是全日历的延伸:

http://www.yiiframework.com/extension/yii2fullcalendar/

1 个答案:

答案 0 :(得分:4)

有很多针对fullcalender的事件,您可以在此link中看到这些事件的列表,您可以在yii2中使用它们

{{1}}