CJuiDatePicker as a CPortlet

I have a need to to place a calander in a porlet that would allow the user to select a date and have the content of the page change. The effect would be simular to the TagCloud portlet in the blog demo.

Can someone help and/or point me in the right direction. I have looked through this forum, the jquery site, and the web in general and can’t find what I am looking for.

I suppose you are using jquery UI datepicker? Check the doc here and more particularly the tab ‘Events’.

Use function ‘change’ on the datepicker or on a hidden ‘altfield’ for tracking changes.

If you are using a datepicker yii extension watch out some of the options/events may not be implemented/supported.

If you want period selection, you will have to write your own little javascript wrapper or check if jquery extensions already fill this purpose.

here is some idea how u can attain ur purpose.

In this example u select the date the page will be redirected to www.rediff.com.

u can send the selected date i.e. ‘dateText’ as query param via get or post to the server & get the data or page for that date.

U can put ajax code to get data from server & update it on the same page.


$this->widget('zii.widgets.jui.CJuiDatePicker', array(

	'attribute' => 'starting_date',

	'model'=>$model,

	'options' => array(

		'showAnim' => 'show',

		'showOn'=>'button',

		'dateFormat' => 'yy/mm/dd',


		'onSelect'=>'js: function(dateText, inst) {

//			alert(dateText);

			window.location = "http://www.rediff.com";

			}',

	),

));