Commit 2196e65f by semenov

Merge branch 'master' into 'release'

Master

See merge request !1
parents f28ae5c3 e1ccaf44
......@@ -45,7 +45,7 @@ class CoreAsset extends AssetBundle
* @var array
*/
public $css = [
'fullcalendar.css',
'fullcalendar.min.css',
];
/**
......@@ -53,7 +53,7 @@ class CoreAsset extends AssetBundle
* @var array
*/
public $js = [
'fullcalendar.js',
'fullcalendar.min.js',
'lang-all.js',
];
......@@ -62,8 +62,8 @@ class CoreAsset extends AssetBundle
* @var array
*/
public $depends = [
'yii2fullcalendar\MomentAsset',
'yii2fullcalendar\PrintAsset',
'skeeks\widget\fullcalendar\MomentAsset',
'skeeks\widget\fullcalendar\PrintAsset',
'yii\jui\JuiAsset'
];
......
......@@ -39,6 +39,8 @@ class FullCalendarWidget extends Widget
'editable' => false,
];
public $clientOptionsJs = "{}";
/**
* Holds an array of Event Objects
* @var array events of yii2fullcalendar\models\Event
......@@ -176,7 +178,7 @@ class FullCalendarWidget extends Widget
}
$cleanOptions = $this->getClientOptions();
$js[] = "$('#$id').fullCalendar($cleanOptions);";
/*$js[] = "$('#$id').fullCalendar(_.extend($cleanOptions, $this->clientOptionsJs));";
//lets check if we have an event for the calendar...
if(count($this->events)>0)
......@@ -187,7 +189,13 @@ class FullCalendarWidget extends Widget
$isSticky = $this->stickyEvents;
$js[] = "$('#$id').fullCalendar('renderEvent',$jsonEvent,$isSticky);";
}
}
}*/
//lets check if we have an event for the calendar...
$js[] = "$('#$id').fullCalendar(_.extend($cleanOptions, $this->clientOptionsJs));";
$view->registerJs(implode("\n", $js),View::POS_READY);
}
......@@ -211,6 +219,12 @@ class FullCalendarWidget extends Widget
$options['eventAfterAllRender'] = new JsExpression($this->eventAfterAllRender);
}
$options = array_merge($options, $this->clientOptions);
if(count($this->events)>0)
{
$options['events'] = $this->events;
}
return Json::encode($options);
}
......
......@@ -26,7 +26,8 @@ class MomentAsset extends AssetBundle
* @var array
*/
public $js = [
'moment.js'
//'moment.js'
'min/moment.min.js'
];
}
......@@ -25,6 +25,12 @@ class Event extends Model
*/
public $title;
/**
* @var background
*/
public $rendering;
/**
* Whether an event occurs at a specific time-of-day. This property affects whether an event's time is shown. Also, in the agenda views, determines if it is displayed in the "all-day" section.
* If this value is not explicitly specified, allDayDefault will be used if it is defined.
......@@ -109,11 +115,14 @@ class Event extends Model
*/
public $textColor;
public $constraint;
public function rules()
{
return [
['id', 'integer'],
['title, allDay, start, end, url, className, source, color, backgroundColor, borderColor, textColor', 'safe'],
['title, allDay, start, end, url, className, source, color, backgroundColor, borderColor, textColor, constraint', 'safe'],
['editable, startEditable, durationEditable', 'boolean'],
];
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment