Skip to content

Commit

Permalink
added option 'defaultView'
Browse files Browse the repository at this point in the history
  • Loading branch information
almix committed Sep 14, 2016
1 parent d7958d5 commit f86623b
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions yii2fullcalendar.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,11 @@ class yii2fullcalendar extends elWidget
*/
public $clientOptions = [
'weekends' => true,
'default' => 'month',
//'default' => 'month',
'editable' => false,
];

public $defaultView = 'month';

/**
* Holds an array of Event Objects
Expand Down Expand Up @@ -163,9 +165,9 @@ protected function registerPlugin()
ThemeAsset::register($view);
}

if (isset($this->options['locale']))
if (isset($this->options['lang']))
{
$assets->language = $this->options['locale'];
$assets->language = $this->options['lang'];
}

if ($this->googleCalendar)
Expand All @@ -185,6 +187,11 @@ protected function registerPlugin()
} else {
$this->clientOptions['header'] = $this->header;
}

if(isset($this->defaultView))
{
$this->clientOptions['defaultView'] = $this->defaultView;
}

// clear existing calendar display before rendering new fullcalendar instance
// this step is important when using the fullcalendar widget with pjax
Expand Down

0 comments on commit f86623b

Please sign in to comment.