FullCalendar

Also, thanks. Certainly be helpful :)

However, when you select and add an event title will not be added :unsure:

And one more question. How to specify the exact time?

For question 1:

This is just a demo about front-end, if you want to save you event then you need Ajax call and some PHP code to save the event object.

For question 2:

Below is a piece of code that can specify the exact time.

array(

‘title’=> ‘test’,

‘start’=> date(‘2010-09-05 13:00:30’),

‘end’=> date(‘2010-09-05 14:30:30’),

‘allDay’ => false

)

The start and end attributes can be also a UNIX timestamp. But allDay attributes must be false if you want specify the exact time.

Although I have tested so many combinations something like that didn’t enter my mind :) Thanks

With regard to the first question I know that it is necessary to combain these two technologies to save.

However concerning displaying itself - it can’t show what you would like to add, i.e. ‘window’ to add title an event emerges but the event after addition doesn’t show itself even temporarily.

My code:


$this->widget('application.extensions.fullcalendar.FullcalendarGraphWidget', 

    array(

        'data'=>array(

			array(

				'title'=> 'test',

				'start'=> date('2010-09-02 06:30'),

				'end'=> date('2010-09-02 07:30'),

				'allDay'=> false

			)

        ),

        'options'=>array(

        	'theme'=> true,

            'editable'=>true,

        	'header' => array(

				'left' => 'prev,next today title',

				'right' => 'month,agendaWeek,agendaDay',

				//'center' => 'title',

			),

			'selectable' => true,

			'selectHelper' => true,

			'select' => "js:function(start, end, allDay) {

				var title = prompt('Event Title:');

				if (title) {

					calendar.fullCalendar('renderEvent',{

						title: title,

						start: start,

						end: end,

						allDay: allDay

					},

					true // make the event 'stick'

					);

				}

				calendar.fullCalendar('unselect');

			}"

		),

        'htmlOptions'=>array(

               'style'=>'width:800px;margin: 0 auto;'

        ),

    )

);

This:


$ ('# Calendar'). FullCalendar ((

is likely to be recorded like this:


'Options' => array (

I have a question how to transform this statement in php


var calendar = $ ('# calendar'). fullCalendar ((

because without this probably does not want to dynamically add events.

Sorry, late to comment

For my mistake I forgot the important code. According to the above code you should change the code “Yii::app()->getClientScript()->registerScript(CLASS.’#’.$id,”$(’#$id’).fullCalendar($encodeoptions);");" in FullcalendarGraphWidget.php to “Yii::app()->getClientScript()->registerScript(CLASS.’#’.$id,“var calendar=$(’#$id’).fullCalendar($encodeoptions);”);”

If done the code can work well.

Enjoy yourself and good luck.

It works. Thanks :)

Thank you so much Bulwaria for posting this example! It was the final piece of help I needed to get the calendar to work. Thanks!

How do you add hyperlinks to the events. Like the one on the Yii extension page demos an event click her for facebook?

‘url’=>‘http://google.com

for anyone who wants to know.

Figured it out.

How can I change color of different events ?

eventBackgroundColor

It’s really works. Thanks…

Hi! I am using the fullcalendar widget updated to version 1.5.3 & am using ajax call for "select" to save an event. The created event is getting saved in database but it is not sticking to the calendar when created. "renderEvent" is not working for me & so is its stick parameter. The events are displayed on reloading the page. But I want to stick the events to the calendar when they are created.

Also, in the week view when i click on any time slot, the slot gets selected with certain delay i.e. if I click on 6:00 am then 7:30 am slot gets selected.

Any help will be appreciated. Thanks in advance.

anybody knows how to add events from MySQL database without using this json-events.html? can I render my data from my controller like this :


public function actionGetTasks() {

        $query = Yii::app()->db->createCommand('SELECT TASKID, STARTTIME, ENDTIME

            FROM task');

        $result = $query->queryAll();

        foreach ($result as $row) {

            $data[] = array(

                'id' => $row['TASKID'],

                'title' => $row['TASKNAME'],

                'start' => $row['STARTTIME'],

                'end' => $row['ENDTIME'],

                'allDay' => false,

            );

        }

        echo str_replace("'", '"', json_encode($data));

    }

and my view (calendar.php):


<div class="two_third maincontent_inner">

    <div class="left">

        <?php

        $this->widget('application.extensions.fullcalendar.FullcalendarGraphWidget',

        array(

        'data' => array(

        'title' => 'All Day Event',

        'start' => date('Y-m-j')//events from database should be here

        ),

        'options' => array(

        'selectable' => true,

        'header' => array(

        'left' => 'prev,next today',

        'center' => 'title',

        'right' => 'month,agendaWeek,agendaDay'

        ),

        ),

        'htmlOptions' => array(

        ),

        )

        );

        ?>

        <br />

    </div><!-- left -->

</div><!-- two_third -->




and how to change the ‘data’=>array so it can read and put the events from my controller?

thanks in advance.

full calendar is not working for yii v 1.1.14

sry it was my mistake, Now it is working

Hi Paskuale,

I saw one of your link on this link.

http://www.yiiframew…6-fullcalendar/

Here You describe a way, how to add different event color to different event.

I am using this thing, But still no color are reflecting on my calender for different event.

Even I am not able to change color of all event, through this property.

Here is my code:

$aray[‘eventBackgroundColor’] = ‘#ff0000’;

I am creating array of data.

Please help.

Thanks

Where can I download fullcalendar for Yii1.1 ?

https://www.yiiframework.com/search?version=1.1&type=extension&q=fullcalendar

1 Like