efullcalendar

Arshaw's FullCalendar as Yii extension
16 followers

This is so far the best calendar library I've seen in my life :) That's what I call a rapid development.

Installation

Just unpack to extensions directory.

Usage

$this->widget('ext.EFullCalendar.EFullCalendar', array(
    // polish version available, uncomment to use it
    // 'lang'=>'pl',
    // you can create your own translation by copying locale/pl.php
    // and customizing it
 
    // remove to use without theme
    // this is relative path to:
    // themes/<path>
    'themeCssFile'=>'cupertino/theme.css',
 
    // raw html tags
    'htmlOptions'=>array(
        // you can scale it down as well, try 80%
        'style'=>'width:100%'
    ),
    // FullCalendar's options.
    // Documentation available at
    // http://arshaw.com/fullcalendar/docs/
    'options'=>array(
        'header'=>array(
            'left'=>'prev,next',
            'center'=>'title',
            'right'=>'today'
        ),
        'lazyFetching'=>true,
        'events'=>$calendarEventsUrl, // action URL for dynamic events, or
        'events'=>array() // pass array of events directly
 
        // event handling
        // mouseover for example
        'eventMouseover'=>new CJavaScriptExpression("js_function_callback"),
    )
));

Example action

public function actionCalendarEvents()
{
    $items[]=array(
        'title'=>'Meeting',
        'start'=>'2012-11-23',
        'color'=>'#CC0000',
        'allDay'=>true,
        'url'=>'http://anyurl.com'
    );
    $items[]=array(
        'title'=>'Meeting reminder',
        'start'=>'2012-11-19',
        'end'=>'2012-11-22',
 
        // can pass unix timestamp too
        // 'start'=>time()
 
        'color'=>'blue',
    );
 
    echo CJSON::encode($items);
    Yii::app()->end();
}

Result

Result

Homepage

Total 6 comments

#12373 report it
Andre Lopez at 2013/03/16 06:18pm
Show HTML

Hello Thanks for this work, any way to show a photo or print html in the event?

Regards

#10762 report it
dyooolicious at 2012/11/22 12:42am
prev next button

why my prev and next buttons won't appears? what is the correct URL to load the image? and what file I need to edit if I want to change these buttons? thanks in advance :)

#10600 report it
schmunk at 2012/11/06 02:59pm
+1 for composer.json!

nice :)

#10559 report it
pod2g at 2012/11/04 10:59pm
The answer

emit, thanks for a quick respond!

followed your coding, but it still not work, but it's still good start point. gonna examine more on this iself...

thanks,pod2g !

#10545 report it
emix at 2012/11/03 08:10pm
The answer

The answer is in the description, you need to pass this function as CJavaScriptExpression, otherwise it will be treated as a string and escaped.

'select'=>new CJavaScriptExpression('function(start, end, allDay) { prompt("Event Title"}')
#10536 report it
pod2g at 2012/11/02 11:43pm
full calendar option

@emit, thanks for nice extension.

however, i (yiibie) am trying to add more option without success:

'select' => 'function(start, end, allDay) { prompt("Event Title"}',

i debug in firebug: show error message b[k].apply is not function.

Can you help me out on this, example would be nice.

Thanks, pod2g

Leave a comment

Please to leave your comment.

Create extension