Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
philippfrenzel committed Jun 16, 2015
2 parents ad6a4b7 + 4bed77f commit 6bee6a8
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 2 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,8 @@ public function actionJsoncalendar($start=NULL,$end=NULL,$_=NULL){
$Event = new \yii2fullcalendar\models\Event();
$Event->id = $time->id;
$Event->title = $time->categoryAsString;
$Event->start = date('Y-m-d\TH:m:s\Z',strtotime($time->date_start.' '.$time->time_start));
$Event->end = date('Y-m-d\TH:m:s\Z',strtotime($time->date_start.' '.$time->time_end));
$Event->start = date('Y-m-d\TH:i:s\Z',strtotime($time->date_start.' '.$time->time_start));
$Event->end = date('Y-m-d\TH:i:s\Z',strtotime($time->date_end.' '.$time->time_end));
$events[] = $Event;
}

Expand Down
27 changes: 27 additions & 0 deletions yii2fullcalendar.php
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,24 @@ class yii2fullcalendar extends elWidget
*/
private $_pluginName = 'fullCalendar';

/**
* The javascript function to us as en eventRender callback
* @var string the javascript code that implements the eventRender function
*/
public $eventRender = "";

/**
* The javascript function to us as en eventAfterRender callback
* @var string the javascript code that implements the eventAfterRender function
*/
public $eventAfterRender = "";

/**
* The javascript function to us as en eventAfterAllRender callback
* @var string the javascript code that implements the eventAfterAllRender function
*/
public $eventAfterAllRender = "";

/**
* Initializes the widget.
* If you override this method, make sure you call the parent implementation first.
Expand Down Expand Up @@ -183,6 +201,15 @@ protected function getClientOptions()
$options['loading'] = new JsExpression("function(isLoading, view ) {
$('#{$id}').find('.fc-loading').toggle(isLoading);
}");
if ($this->eventRender){
$options['eventRender'] = new JsExpression($this->eventRender);
}
if ($this->eventAfterRender){
$options['eventAfterRender'] = new JsExpression($this->eventAfterRender);
}
if ($this->eventAfterAllRender){
$options['eventAfterAllRender'] = new JsExpression($this->eventAfterAllRender);
}
$options = array_merge($options, $this->clientOptions);
return Json::encode($options);
}
Expand Down

0 comments on commit 6bee6a8

Please sign in to comment.