From 8f421e464e357dbf982cb8537dcf2fb8335e086c Mon Sep 17 00:00:00 2001 From: "Victor Lavaud (qdii)" Date: Sun, 1 Mar 2015 11:21:08 +0100 Subject: [PATCH 1/4] new members eventRender and eventAfterRender permit specifying the JS rendering callbacks --- yii2fullcalendar.php | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/yii2fullcalendar.php b/yii2fullcalendar.php index 6b51c5f..866dea3 100644 --- a/yii2fullcalendar.php +++ b/yii2fullcalendar.php @@ -86,6 +86,18 @@ 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 = ""; + /** * Initializes the widget. * If you override this method, make sure you call the parent implementation first. @@ -181,6 +193,12 @@ 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); + } $options = array_merge($options, $this->clientOptions); return Json::encode($options); } From 24d24fb7864460045ffa53440209e354c7226500 Mon Sep 17 00:00:00 2001 From: "Victor Lavaud (qdii)" Date: Thu, 5 Mar 2015 21:54:29 +0100 Subject: [PATCH 2/4] added eventafterallrender --- yii2fullcalendar.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/yii2fullcalendar.php b/yii2fullcalendar.php index 866dea3..a3f6f18 100644 --- a/yii2fullcalendar.php +++ b/yii2fullcalendar.php @@ -98,6 +98,12 @@ class yii2fullcalendar extends elWidget */ 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. @@ -199,6 +205,9 @@ protected function getClientOptions() 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); } From 05aca3be16d80cb3198bb4253c1e5692845045e9 Mon Sep 17 00:00:00 2001 From: imagoconsulting Date: Sun, 22 Mar 2015 22:46:06 -0400 Subject: [PATCH 3/4] Update README.md incorrect format character for minute. (should be i not m). --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 597d70f..f45a1a3 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_start.' '.$time->time_end)); $events[] = $Event; } From 97618b2b10c09bb1c3f25a72ab656469c86e5821 Mon Sep 17 00:00:00 2001 From: imagoconsulting Date: Sun, 22 Mar 2015 22:50:12 -0400 Subject: [PATCH 4/4] Update README.md minor edit (I think it was intended date_end) likely a copy/paste error :) --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index f45a1a3..8c9a978 100644 --- a/README.md +++ b/README.md @@ -98,7 +98,7 @@ public function actionJsoncalendar($start=NULL,$end=NULL,$_=NULL){ $Event->id = $time->id; $Event->title = $time->categoryAsString; $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_start.' '.$time->time_end)); + $Event->end = date('Y-m-d\TH:i:s\Z',strtotime($time->date_end.' '.$time->time_end)); $events[] = $Event; }