Yii Framework Forum: FullCalendar - Yii Framework Forum

Jump to content

  • (2 Pages)
  • +
  • 1
  • 2
  • You cannot start a new topic
  • You cannot reply to this topic

FullCalendar Rate Topic: -----

#1 User is offline   Bulwaria 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 10
  • Joined: 27-August 10

Posted 27 August 2010 - 02:22 AM

Have anyone ever had to do with FullCalendar extension? If so, anyone perhaps knows how to add second event.
The following code can't add second event.

<?php 
$this->widget('application.extensions.fullcalendar.FullcalendarGraphWidget', 
    array(
        'data'=>array(
    		array(
    			'id'=>'11',
                'title'=> 'All Day Event',
                'start'=> date('2010-08-21'),
    			'end'=> date('2010-08-23'),
		    ),
		    array(
    			'id'=>'15',
                'title'=> 'Big Day',
                'start'=> date('2010-08-27'),
		    )
        ),
        'options'=>array(
            'editable'=>true,
        ),
        'htmlOptions'=>array(
               'style'=>'width:800px;margin: 0 auto;'
        ),
    )
);
?>

0

#2 User is offline   Bulwaria 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 10
  • Joined: 27-August 10

Posted 31 August 2010 - 05:09 AM

I realize that no one was occupied with it.
0

#3 User is offline   thyseus 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 300
  • Joined: 18-April 09
  • Location:Leipzig, Germany

Posted 01 September 2010 - 08:48 AM

View PostBulwaria, on 31 August 2010 - 05:09 AM, said:

I realize that no one was occupied with it.


I am.

You need to fix one line in the FullCalendar Widget.

Open the FullCalendarGraphWidget.php and change line 25 to:

$encodeoptions=CJavaScript::encode($this->options+array('events'=>$this->data));

good luck :)
2

#4 User is offline   Bulwaria 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 10
  • Joined: 27-August 10

Posted 01 September 2010 - 02:22 PM

View Postthyseus, on 01 September 2010 - 08:48 AM, said:

I am.

You need to fix one line in the FullCalendar Widget.

Open the FullCalendarGraphWidget.php and change line 25 to:

$encodeoptions=CJavaScript::encode($this->options+array('events'=>$this->data));

good luck :)



It works. Thanks :)
0

#5 User is offline   Vincent Dong 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 4
  • Joined: 02-September 10

Posted 02 September 2010 - 03:41 AM

View PostBulwaria, on 01 September 2010 - 02:22 PM, said:

It works. Thanks :)

Yeah, it works fine.
0

#6 User is offline   Vincent Dong 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 4
  • Joined: 02-September 10

Posted 02 September 2010 - 03:48 AM

View Postthyseus, on 01 September 2010 - 08:48 AM, said:

I am.

You need to fix one line in the FullCalendar Widget.

Open the FullCalendarGraphWidget.php and change line 25 to:

$encodeoptions=CJavaScript::encode($this->options+array('events'=>$this->data));

good luck :)

According this fix.
/*
$encodeoptions=CJavaScript::encode($this->options+array('events'=>$this->data));
*/

You can get a full calendar with event adding/dragging by these code.
<?php
$this->widget('application.extensions.fullcalendar.FullcalendarGraphWidget',
array(
'data'=>array(
array(
'title'=> 'All Day Event',
'start'=> date('2010-09-01'),
'end'=> date('2010-09-02'),
),
array(
'title'=> 'test',
'start'=> date('2010-09-05'),
'end'=> date('2010-09-06'),
)
),
'options'=>array(
'editable'=>true,
'header' => array(
'left' => 'prev,next today',
'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:720px;margin: 0 auto;'
),
)
);
?>
1

#7 User is offline   Bulwaria 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 10
  • Joined: 27-August 10

Posted 02 September 2010 - 06:54 AM

Also, thanks. Certainly be helpful :)
0

#8 User is offline   Bulwaria 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 10
  • Joined: 27-August 10

Posted 02 September 2010 - 07:30 AM

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

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

#9 User is offline   Vincent Dong 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 4
  • Joined: 02-September 10

Posted 02 September 2010 - 09:15 PM

View PostBulwaria, on 02 September 2010 - 07:30 AM, said:

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.
1

#10 User is offline   Bulwaria 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 10
  • Joined: 27-August 10

Posted 03 September 2010 - 02:00 AM

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;'
        ),
    )
);

1

#11 User is offline   Bulwaria 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 10
  • Joined: 27-August 10

Posted 07 September 2010 - 08:54 AM

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.
0

#12 User is offline   Vincent Dong 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 4
  • Joined: 02-September 10

Posted 26 September 2010 - 03:21 AM

View PostBulwaria, on 07 September 2010 - 08:54 AM, said:

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.
0

#13 User is offline   Bulwaria 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 10
  • Joined: 27-August 10

Posted 27 September 2010 - 01:18 AM

It works. Thanks :)
0

#14 User is offline   RobertAlpha 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 1
  • Joined: 08-September 11

Posted 09 September 2011 - 06:55 AM

View PostBulwaria, on 03 September 2010 - 02:00 AM, said:

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:
.....


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!
0

#15 User is offline   Preacher 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 74
  • Joined: 01-October 11

Posted 28 October 2011 - 12:53 PM

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

#16 User is offline   Preacher 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 74
  • Joined: 01-October 11

Posted 28 October 2011 - 01:05 PM

View PostPreacher, on 28 October 2011 - 12:53 PM, said:

How do you add hyperlinks to the events.
On the Yii extension page it demos an event with a title of: click here for facebook?



'url'=>'http://google.com'

for anyone who wants to know.

Figured it out.
0

#17 User is offline   umert 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 1
  • Joined: 22-February 12

Posted 21 March 2012 - 03:34 AM

How can I change color of different events ?
0

#18 User is offline   paskuale 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 384
  • Joined: 30-December 11
  • Location:Italy, Bari

Posted 15 May 2012 - 01:49 AM

eventBackgroundColor
0

#19 User is offline   deepeshsaini 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 12
  • Joined: 30-May 12
  • Location:india

Posted 05 July 2012 - 03:05 AM

View Postthyseus, on 01 September 2010 - 08:48 AM, said:

I am.

You need to fix one line in the FullCalendar Widget.

Open the FullCalendarGraphWidget.php and change line 25 to:

$encodeoptions=CJavaScript::encode($this->options+array('events'=>$this->data));

good luck :)



It's really works. Thanks..........
0

#20 User is offline   freshDeveloper 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 1
  • Joined: 30-August 12

Posted 30 August 2012 - 08:23 AM

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.
0

Share this topic:


  • (2 Pages)
  • +
  • 1
  • 2
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users