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();
}
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
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"}')
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 !
+1 for composer.json!
nice :)
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 :)
Show HTML
Hello Thanks for this work, any way to show a photo or print html in the event?
Regards
Google calendar
as if I want to join google calendar events and an array that I have with events ?
Please update at latest version
Excellent work !
Can you update extension to latest full calendar release ?
Very cool!
Thanks for this!
Could you please advice on how can I send the current month and year to my URL that fetches data? Otherwise, I would end up getting all the events from my table.
Thanks in advance
Regards!
:)
Answering myself
Ok, after all, for those who are stuck on the same point I was, the solution for filtering only data between the start and end of month your calendar is showing:
in your controller (URL for dynamic event items), get the two automatic parameters sent by fullcalendar:
CHttpRequest::getParam('start',null); CHttpRequest::getParam('end',null);
These params are Unix timestamps, so you just have to treat them and handle to filter your db query
Hope this helps someone else
Regards
:)
Please update at latest version
I created a pull request on github project with 1.6.4 version and italian locale added
I can confirm this extension works with v1.6.4 & how to code a viewRender function
This extension (as of 22-12-2013) comes with fullcalendar v1.5.4. I just downloaded v1.6.4 from http://arshaw.com/fullcalendar/download/ and updated the contents of the assets/fullcalendar directory.
Hint, to implement a viewRender function just set it as a option and prefix the javascript function with js: to prevent the CJavaScript class escaping the javascript function.
This example adds a button to every day of the calendar to the left of the day number
$url_job_create = '/someurl/; $this->widget('ext.EFullCalendar.EFullCalendar', array( 'id' => 'diary', // 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,month,basicWeek' ), 'firstDay' => 1, 'weekNumbers' => true, 'lazyFetching'=>true, 'contentHeight' => 350, 'events'=>CController::createUrl('diary/CalendarEvents'), 'viewRender' => "js:function (view, element) { var job_create_url = '$url_job_create'; console.log(view); console.log(element); $('#diary.fc-day-number').each(function() { var dateYMD = $(this).parent().parent().data('date'); var d = new Date(dateYMD); var tmpDay = pad(d.getDate(),2); var tmpMonth = pad(d.getMonth()+1,2); var tmpYear = d.getFullYear(); var dateDMY = tmpDay + '/' + tmpMonth + '/' + tmpYear; var day = parseInt($(this).html()); $(this).html('<a href=\"' + job_create_url + dateDMY + '\"><img src=\"./images/icon-add-job_16x16.png\" alt=\"Add job\" /></a> ' + day); }); }", ), ) );
Strange Error when enabling the 'themeCssFile'=>'cupertino/theme.css',
Hi guys,
Thanks for the extention.
I tried this ext, and it didn't work well until "'themeCssFile'=>'cupertino/theme.css'," was commented out.
The "current week" days in month view refused to accept any events and events ended up on the top row of calendar.
There were also problems with "day view" and "week view" which all together vanished when the theme was removed.
By the way the fullCalendar version is also a bit old in this extension and I have read that many bugs have been fixed in the newer version.
I write this to give a heads up.
Have a nice time. :)
Nice extension, but setting up is a pain
Hi,
first, thanks for this awesome extension. But to get it up is a pain. Actually it is quite easy to setup, but because the example usage given here is not working (I am not sure if I am the only one experienced it), it caused some confusion.
For new user, to start with, use the most basic options and DON'T FORGET TO COMMENT OUT THE CUPERTINO THEME.
<?php $this->widget('ext.EFullCalendar.EFullCalendar', array( // 'themeCssFile'=>'cupertino/jquery-ui.min.css', //comment this out 'options'=>array( 'header'=>array( 'left'=>'prev,next', 'center'=>'title', 'right'=>'today' ) ))); ?>
I am not sure why, but it is not working when the theme is activated, but once the theme is commented, it works swiftly.
Next, the example action does not seems to work as well (again I am not sure if I am the only one experienced it). The event won't appear in my calendar. Apparently I found that it seems to have some problem in interpreting the date in the following format 'start'=>'2012-11-23', so I replace it with PHP date, i.e. 'start'=>strtotime('2012-11-23'). Then everything work swiftly. All the thing next will be pure entertainment seeing how beautiful this extension is.
Useful Information
I would like to add more useful information about efullcalendar.
One of the most important features for calendar is that we want to only load the events that are limited to the current view of the user. Means, we do not want to load events for the whole year and feed it into the fullcalendar when the user is only viewing the current month.
Most of us are aware that we can put a controller action in the events options of fullcalendar
'events'=>Yii::app()->createUrl('calendar/calendarEvents'),
So we will usually put all our database retrieval code the the controller action. But in order to retrieve data based on user current view, we need to know the start and end time of the user current view. For instance, if user is viewing Feburary, then the start will be at least from 1st Feb to 28 (or 29) Feb.
The good thing about fullcalendar is that the call to the action is actually an ajax call where it is done automatically when the calendar need to get data. See detail at
http://arshaw.com/fullcalendar/docs/event_data/events_function/
So, within the controller action, there will be 2 variable passed in through ajax in GET, the variable can be accessed via $_GET['start'] and $_GET['end'] where they are in php time format.
So with the 2 variables, you can filter your data using the start time and end time of the current user view.
Here is a sample code of my controller
public function actionCalendarEvents() { //This method is an ajax call where 2 arguments will be passed into the method via $_GET['start'] and $_GET['end'] $events = Event::model()->findAll(array( 'condition'=>'start_day >= :start and end_day <= :end', 'params'=>array(':start'=>$_GET['start'], ':end'=>$_GET['end']), 'order'=>'start_day' )); /////////////////////////////////// $items = array(); foreach($events as $event) { $items[]=array( 'title'=>$event->e_name, 'start'=>$event->start_day, 'end'=>$event->end_day, 'allDay'=>$event->all_day == 1 ? true : false, 'editable'=>true, 'color'=>$event->background_color == '' ? '' : $event->background_color, ); } echo CJSON::encode($items); Yii::app()->end(); }
[HOW TO] Return Selected Date in specific controller
I was able to set it up to alert() SELECTED DATE,
at the same time alert() the week mon and fri date.
$this->widget('ext.EFullCalendar.EFullCalendar', array( 'themeCssFile'=>'cupertino/theme.css', 'options'=>array( 'header'=>array( 'left'=>'prev,next', 'center'=>'title', 'right'=>'today', ), 'selectable' => true, 'selectHelper'=>true, 'dayClick'=>new CJavaScriptExpression( "function(start, allDay, jsEvent, view) { $(this).parent().siblings().removeClass('week-highlight'); $(this).parent().addClass('week-highlight'); var date = new Date(); var now = date? new Date(start-1) : new Date(); now.setHours(0,0,0,0); var monday = new Date(now); monday.setDate(monday.getDate() - monday.getDay() + 1); var friday = new Date(now); friday.setDate(friday.getDate() - friday.getDay() + 5); var mondaydate = $.fullCalendar.formatDate(monday,'yyyy-MM-dd'); var fridaydate = $.fullCalendar.formatDate(friday,'yyyy-MM-dd'); alert('Start Date: ' + mondaydate + ' -> End Date: ' + fridaydate); $(this).css('background-color', 'red'); }" ), )
BUT How do I return the selected Date and the week date to a Specific Controller for processing?
@JbalTero
@JbalTero
Just define a callback function for that specific fullcalendar event and make a AJAX request in it.
Here are some of the events:
drop
eventClick
eventResize
eventDrop
RE: [HOW TO] Return Selected Date in specific controller
Here is my suggestion on how you can resolve the problem.
In Yii, we usually make Ajax call from PHP code. This is widely know so there will be no issue with it.
The problem with efullcalendar is that everything is in javascript. We can get javascript to work and make an alert to the action of user, but how to let the javascript make an ajax call to a controller action and pass the value to the controller?
The answer can be found here Javascript and Ajax with Yii. Look at 1.3.2.
Using the provided javascript format, you can make an ajax call to Yii controller and pass the value to the controller.
Hope it helps.
RE: @Muhammad Rafiq and @bandpay; [HOW TO] Return Selected Date in specific controller
I followed the link and this is now my code,
<?php $quotedUrl = CJavaScript::encode($this->createUrl('ajaxcomplete')); $this->widget('ext.EFullCalendar.EFullCalendar', array( 'themeCssFile' => 'cupertino/theme.css', 'options' => array( 'header' => array( 'left' => 'prev,next', 'center' => 'title', 'right' => 'today', ), 'selectable' => true, 'selectHelper' => true, 'height' => 50, 'dayClick' => new CJavaScriptExpression( "function(start, allDay, jsEvent, view) { //some logic here... $.ajax({ url: $quotedUrl, data: { 'selectedDate': selectedDate, 'mondayDate': mondayDate, 'fridayDate': fridayDate, }, success: function(data){ alert('Success!'); }, }); $(this).css('background-color', 'red'); }" ), ) )); ?>
Controller
public $data = array(); public function actionAjaxComplete() { $data['selectedDate'] = $_GET['selectedDate']; $data['mondayDate'] = $_GET['mondayDate']; $data['fridayDate'] = $_GET['fridayDate']; }
My problem is whenever I click a day in the calendar, it will just invoke the alert('Success!') and I don't really happens next and don't know what to do next.
RE: @Muhammad Rafiq and @bandpay; [HOW TO] Return Selected Date in specific controller
Hi JbalTero,
If you can get the alert of Success, it means that your ajax was successfully sent through. What you are facing now is more of the ajax programming issue. The complicated part about ajax programming is that you can't see the effect off the ajax process and debugging is also difficult because you do not know what has been sent through and how to see them.
This is what I did.
echo '<div id="div1"></div>'; //this div will be used to display the output for debugging purpose // Your ecalendar code.... ... ... 'dayClick' => new CJavaScriptExpression( "function(start, allDay, jsEvent, view) { //some logic here... $.ajax({ url: $quotedUrl, data: { 'selectedDate': start, }, success: function(data){ $(\"#div1\").html(data); }, }); $(this).css('background-color', 'red'); }"
I replaced the success alert by outputting the result into a div (i.e. div1 which I declared earlier) so you can effectively see the result.
In your controller, simply dump out the $_GET variable and you can see very well if the data are passed into your controller.
public function actionAjaxComplete() { print_r($_GET); }
If everything is good, you will see something like
Array ( [selectedDate] => Tue Mar 04 2014 00:00:00 GMT+0300 (Arab Standard Time) )
printed on top of your calendar after you clicked on a date
If you see that, you can proceed to extract the date from the $_GET variable, i.e. $_GET['selectedDate'] and do the necessary processing for your program. You can continue to do all the processing and echo the result and it will appear in the div. Once everything is alright, you can remove the div and the Success action.
BTW I am not sure if this part of your code is correct because in the dayClick function, I do not see selectedDate, mondayDate, fridayDate are being passed into the function.
'selectedDate': selectedDate, 'mondayDate': mondayDate, 'fridayDate': fridayDate,
In addition, for a more user friendly variable dumping, I recommend you to use the following code. It will print out more human readable output of your variable, be it object or array. Example of usage, $this->printObject($_GET);
public function printObject($object, $ret=FALSE) { if(!$ret) echo '<pre>' . htmlspecialchars(print_r($object,true)) . '</pre>'; else return '<pre>' . htmlspecialchars(print_r($object,true)) . '</pre>'; }
@Muhammad Rafiq
Thank you very much! It worked! :)
question!!
hi !! can someone please tell me how to fill this calendar from the database
@AhmedK
Hello
This is my example:
Use the AJAX call to get your event schedules and deliver them to the callback function
'events'=>'js:function(start, end, callback) { $.ajax({ url: "'.$this->createUrl('fullCalendarEvents',array('id'=>$model->id)).'", dataType: "json", data: { start_date: Math.round(start.getTime() / 1000), end_date: Math.round(end.getTime() / 1000), }, success: function(shifts) { callback(shifts); } }); }',
question!!
do i have to generate crud for this calendar ?? im new in yii and im relay confused right here !! thx for your help :)
@AhmedK
What is it you wish to show on the calendar?
@bandpay
im making an application for doctor ive completed the patient side !! now i like to display a calendar with appointment for the patients !! thank you for your help
@AhmedK
Hello,
If you already have the CRUD for the appointments then your are all set to fetch them and deliver them in JSON encoded format to the AJAX call.
@bandpay
so i have to generate my crud and then send them to the calendar as json format !!
i have ( id, description, patient_name, start_time, end_time, location)!!
@AhmedK
Yes my firend.
You have to populate an $events array with your data.
Create a function in your model that delivers the $events array
This code is for guidance purpose and is not of any other value.
public function fetchEvents(){ $events=[]; foreach($schedules as ........){ $events[] = [ 'id'=>'some_uniquid', 'data'=>[ 'var1'=>'val1', 'var2'=>'val2', 'varn'=>'valn', ], 'title'=>'Some_Title', 'start'=>'a start date with this format Y-m-d H:i:s', 'end'=>'an end date with this format Y-m-d H:i:s', 'allDay'=>$isAllDay?true:false, 'url'=>Yii::app()->createUrl('controller/action',['someVar'=>'someVal']), ]; } return $events; } /* call it in the controller/action which the AJAX call makes in the fullCalendar events function then the $events must be json_encode()'d */ echo json_encode($model->fetchEvents()); exit;
I hope that it helps.
:)
heeeeeeeeeeellllllpppppppp !!
ive made this but nothing is working !!
where must i display the calendar !! ive put it in the index view!!
<?php $this->widget('ext.EFullCalendar.EFullCalendar', array( 'lang'=>'fr', //'themeCssFile'=>'cupertino/theme.css', '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,month,agendaWeek,agendaDay' ), 'lazyFetching'=>true, 'events'=>CController::createUrl('CalendrierController/CalendarEvents'), ) )); ?>
in my controller
public function actionCalendarEvents() { $items[]=array( 'title'=>'Meeting', 'start'=>'2014-03-09', 'color'=>'#CC0000', 'allDay'=>true, 'url'=>'http://anyurl.com' ); $items[]=array( 'title'=>'Meeting reminder', 'start'=>'2014-03-10', 'end'=>'2014-03-11', // can pass unix timestamp too // 'start'=>time() 'color'=>'blue', ); echo CJSON::encode($items); Yii::app()->end(); }
Re: AhmedK
2 things you should pay attention in your actionCalendarEvents()
'start'=>'2014-03-09',
try to change it to
'start'=>strtotime('2014-03-09'),
The same goes for the second array.
public function actionCalendarEvents() { $items[]=array( 'title'=>'Meeting', 'start'=>'2014-03-09', 'color'=>'#CC0000', 'allDay'=>true, 'url'=>'http://anyurl.com' ); $items[]=array( 'title'=>'Meeting reminder', 'start'=>'2014-03-10', 'end'=>'2014-03-11', // can pass unix timestamp too // 'start'=>time() 'color'=>'blue', ); echo CJSON::encode($items); Yii::app()->end(); }
@AhmedK :)
Don't panik
Just try harder :)
@bandpay @muhammad RAfiq
hi guys !! ive made a calendar model and generated the crud !! ive puted the calendar view in the index of the calendar model !! ive puted the fonction action CalendarEvents in the controller !! but it's not working !!
public function accessRules() { return array( array('allow', // allow all users to perform 'index' and 'view' actions 'actions'=>array('index','view','CalendarEvents'), 'users'=>array('*'), ), array('allow', // allow authenticated user to perform 'create' and 'update' actions 'actions'=>array('create','update','admin','delete','CalendarEvents'), 'users'=>array('@'), ), array('allow', // allow admin user to perform 'admin' and 'delete' actions 'actions'=>array('admin','delete'), 'users'=>array('admin'), ), array('deny', // deny all users 'users'=>array('*'), ), ); }
public function actionCalendarEvents() { $items[]=array( 'title'=>'Meeting', 'start'=>strtotime('2014-03-09'), 'color'=>'#CC0000', 'allDay'=>true, 'url'=>'http://anyurl.com' ); $items[]=array( 'title'=>'Meeting reminder', 'start'=>strtotime('2014-03-10'), 'end'=>strtotime('2014-03-11'), 'color'=>'blue', ); echo CJSON::encode($items); Yii::app()->end(); }
<?php $this->widget('ext.EFullCalendar.EFullCalendar', array( '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,month,agendaWeek,agendaDay' ), 'lazyFetching'=>true, //'events'=>CController::createUrl('CalendrierController/CalendarEvents'), //'events'=>$calendarEventsUrl, 'event'=>Yii::app()->createUrl('CalendrierController/CalendarEvents'), // // action URL for dynamic events, or // 'events'=>'[{"title":"Meeting","start":"2014-03-09","color":"#CC0000","allDay":true,"url":"http:\/\/anyurl.com"}]', // pass array of events directly // event handling // mouseover for example // 'eventMouseover'=>new CJavaScriptExpression("js_function_callback"), ) )); ?>
@bandpay @muhammad RAfiq
why when i put this 'events'=>$calendarEventsUrl, it says Undefined variable: calendarEventsUrl ???
@AhmedK
My friend,
I told you to take it easy :)
'event'=>Yii::app()->createUrl('CalendrierController/CalendarEvents'),
it is 'events' not 'event'
and check in the accessRules if the CalendarEvents should be spelled "calendarEvents"
I have other problems which are as big for me as this one is for you :)
Re: AhmedK
Greeting,
I spotted 2 problems
First, it should be 'events' => Yii::app()->createUrl
Note the 's' in the event
2nd, when you use createUrl, you have to use the class name of the controller, i.e. if my controller is CalendarController, I will use Yii::app()->createUrl('calendar/CalendarEvents')
Note the calendar in createUrl is without the controller word.
I tried your code and dump it into my own program by fixing the 2 issues above and it works for me.
@bandpay @muhammad RAfiq
hi im getting my json under the calender :)
[{"title":"Meeting","start":"2014-03-09","color":"#CC0000","allDay":true,"url":"http:\/\/anyurl.com"},{"title":"Meeting reminder","start":"2014-03-10","end":"2014-03-11","color":"blue"}]
@AhmedK
Tell me that it's working, so we are all happy :)
Please use forum, not comment for discussion !!!
If you have some long term discussion opened, please use forum, and NOT comment.
This because every user, like me, which has starred this esxtension will receive an email every time a comment is posted.
Please, stop...
New Extension EFullCalendarHeart
I am only make this extension support with Arshaw FullCalendar version 2.XX
Check it EFullCalendarHeart
ajax renderpartial?
first off - incredible extension. this has made my entire project possible, and for that i'm grateful. i'm using this in several different places throughout my app, but i ran into a problem today. in my page i have a div that i load via ajax/renderpartial that contains the EFullCalendar. when i visit the page on my (slow) Macbook pro dev machine, it works fine. when i deploy to my (lightning fast) production environment on AWS EB, its almost like the assets load last - the div loads, i get an error saying $(...).fullCalendar is not a function and in Firebug i can see that fullcalendar.js loads way after the error. how can i make this extension work via renderpartial/ajax?
server problem !!
hi guys :) i used this extention in my project and it's worked fine on localhost but when i puted the website on server it says
The alias " ext.EFullCalendar.EFullCalendar" is invalid. Check that points to an existing PHP file.
also when i tried application.extensions.EFullCalendar.EFullCalendar it doesn't work did anyone had the same problem with this extension on server !!
Server problems
@AhmedK make sure your server isn't case sensitive - check the spelling of your code against the name and path of the widget.
Help... my views displays so:
[{"title":"Meeting","start":1394319600,"color":"#CC0000","allDay":true,"url":"http:\/\/anyurl.com"},{"title":"Meeting reminder","start":1394406000,"end":1394492400,"color":"blue"}]
my controller is
public function actionIndex()
{
$items[]=array( 'title'=>'Meeting', 'start'=>strtotime('2014-03-09'), 'color'=>'#CC0000', 'allDay'=>true, 'url'=>'http://anyurl.com' ); $items[]=array( 'title'=>'Meeting reminder', 'start'=>strtotime('2014-03-10'), 'end'=>strtotime('2014-03-11'), 'color'=>'blue', ); echo CJSON::encode($items); Yii::app()->end();
}
my views is:
<?php $this->widget('ext.EFullCalendar.EFullCalendar', array(
'themeCssFile'=>'cupertino/jquery-ui.min.css', 'options'=>array( 'header'=>array( 'left'=>'prev,next', 'center'=>'title', 'right'=>'today' ) )));
?>
where is my mistake??
@colombo
@colombo
I think that you have not defined the events in the options section. Take a closer look at the code snippets on this page.
Good luck
'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"), )
Thanks
You are right...
eventDrop... helppppp
This is my my option array into the widget:
'options'=>array(
'editable'=>true, 'eventDrop'=>'function(event, delta, revertFunc, jsEvent, ui, view) { alert(event.title+" ora in "+ event.start.format()); }', .... )
i get the follow js error wher i try move an event to a different day:
TypeError: options[name].apply is not a function in http://localhost/immobiliare/assets/ed9bd66f/fullcalendar/fullcalendar.js:643
Somebody can help me to understand which is the problem??
Why my events are always coming in All day event slot?
Here is my data,
$items[] = array( 'title' => 'Meeting', 'start' => strtotime('2014-09-09'), 'color' => '#CC0000', 'allDay' => true, 'url' => 'http://anyurl.com' ); $items[] = array( 'title' => 'Meeting reminder', 'start' => '2014-09-15 05:20:17', 'end' => '2014-09-15 05:30:17', 'color' => 'blue', ); echo CJSON::encode($items); Yii::app()->end();
And another issue i have is when enable true as below, it says
'editable'=>'true', 'selectable' => true,
Property "EFullCalendar.editable" is not defined.
heeeeeelllllpppppp!!!!
i have a problem with the array for the events
this is my widget in the view..
$this->widget('ext.EFullCalendar.EFullCalendar', array( 'lang'=>'it', 'themeCssFile'=>'cupertino/theme.css', 'options'=>array( 'header'=>array( 'left'=>'prev,next', 'center'=>'title', 'right'=>'today' ), 'editable'=>'true', 'selectable' => true, 'dayClick'=>'js:function(event, eventElement){selezionaGiorno(event);}', 'lazyFetching'=>false, 'events'=>array('title'=>'Meeting', 'start'=>'2015-01-10T10:00:00', 'end'=> '2015-01-10T16:00:00', 'color'=>'#CC0000', ), ), 'htmlOptions'=>array( 'style'=>'background-color:#fff;border-radius: 10px;border:0px solid #555;padding:5px;', ), ));
i dont see the date in the layout of calendar!!!
Who can help me??...please....
hijri calendar support
is this support hijri calendar ? any other ?
efullcalendar display blank page
<?php $this->widget('ext.EFullCalendar.EFullCalendar', array( 'themeCssFile'=>'cupertino/theme.css', 'htmlOptions'=>array( 'style'=>'width:100%' ), 'options'=>array( 'header'=>array( 'left'=>'prev,next', 'center'=>'title', 'right'=>'today' ), 'lazyFetching'=>true, //'events'=>$calendarEventsUrl, // action URL for dynamic events, or //'events'=>Yii::app()->createUrl('site/CalendarEvents'), 'events'=>array('title'=>'Meeting', 'start'=>'2015-01-10T10:00:00', 'end'=> '2015-01-10T16:00:00', 'color'=>'#CC0000'), // pass array of events directly 'eventMouseover'=>new CJavaScriptExpression("js_function_callback"), ), )); ?>
my code is as above. it not display any thing only blank div is added in page but no other content was displayed
anyone there to answer me a
in case of multiday events nothing is rendering on calendar but response is success but if i set the event only for a day in a month it will display the event ..anyone there to answer me pls ?
I need to show an image in the event click
<?php
// $baseUrl = Yii::app()->theme->baseUrl;
$v=Yii::app()->baseUrl.'/images/Eventos/'; $fi='Cimafunk.jpg'; $events = Promocionevento::model()->findAll(); $itemss = array(); foreach($events as $event) { $itemss[]=array( 'title'=>$event->descripcion, 'nombre'=>$event->idtipo0->nombre, 'start'=>$event->inicio, 'end'=>$event->fin, 'allDay'=>1, 'editable'=>false, 'color'=>$event->idtipo0->color, 'label'=>$event->contenido, 'icon'=>$event->idtipo0->icono, 'id'=>$event->id, 'fich'=>'<img src="<?php echo $v.$fi?>">', 'fic'=>'Chtml::image($v.$fi)', ); $i++; }
$this->widget('ext.EFullCalendar.EFullCalendar', array(
"lang"=>'es', 'htmlOptions'=>array( 'style'=>'height:auto;margin: 50 auto' ), 'options'=>array( 'eventDrop' => 'js:function(event,dayDelta,minuteDelta,revertFunc) { alert(1); }', 'header'=>array( 'left'=>'title',
// 'center'=>'title',
'right'=>'prev,next', ), 'dropable'=>true, 'firstDay' => 1, 'weekNumbers' => true, 'lazyFetching'=>true, 'contentHeight' => 350, 'events'=>$itemss, 'url'=>$this->createUrl('/eventos/admin'), 'eventClick'=> 'js:function(calEvent, jsEvent, view) { $("#myModalHeader").html(calEvent.icon+" "+calEvent.nombre+" "+calEvent.icon); $("#myModalBody").html(calEvent.label); $("#myModal").modal(); }', 'selectable' => true, 'selectHelper'=>true, ), ) );
?>
If you have any questions, please ask in the forum instead.
Signup or Login in order to comment.