diff --git a/README.md b/README.md index 597d70f..8c9a978 100644 --- a/README.md +++ b/README.md @@ -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; } diff --git a/yii2fullcalendar.php b/yii2fullcalendar.php index ae1324c..1ab3707 100644 --- a/yii2fullcalendar.php +++ b/yii2fullcalendar.php @@ -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. @@ -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); }