Well there’s something different from what I use. Let’s say your model is named “Model”, I’d use the code below. Try it and tell me:
<?php $this->widget('zii.widgets.jui.CJuiDatePicker', array(
'model'=>$model,
'attribute'=>'checkin',
'name'=>'Model[checkin]',
'language'=>Yii::app()->language,
'options'=>array(
'onSelect'=>'js:function(selectedDate) {
$("#Model_checkout").datepicker("option", "minDate", selectedDate);
}',
'showAnim'=>'fold',
'showOn'=>'both',
'buttonText'=>Yii::t('ui','Full calendar'),
'buttonImage'=>$baseUrl.'/images/calendar.png',
'buttonImageOnly'=>false,
'changeMonth'=>true,
'changeYear'=>true,
'showButtonPanel'=>true,
'autoSize'=>false,
'yearRange'=>'1980:2020',
'minDate'=>'+0'
),
'htmlOptions'=>array(
'size'=>10,
'style'=>'width:80px;vertical-align:top'
),
));
?>
…
<?php $this->widget('zii.widgets.jui.CJuiDatePicker', array(
'model'=>$model,
'attribute'=>'checkout',
'name'=>'Model[checkout]',
'language'=>Yii::app()->language,
'options'=>array(
'onSelect'=>'js:function(selectedDate) {
$("#Model_checkin").datepicker("option", "maxDate", selectedDate);
}',
'showAnim'=>'fold',
'showOn'=>'both',
'buttonText'=>Yii::t('ui','Full calendar'),
'buttonImage'=>$baseUrl.'/images/calendar.png',
'buttonImageOnly'=>false,
'changeMonth'=>true,
'changeYear'=>true,
'showButtonPanel'=>true,
'autoSize'=>false,
'yearRange'=>'1980:2020',
'minDate'=>'+0'
),
'htmlOptions'=>array(
'size'=>10,
'style'=>'width:80px;vertical-align:top'
),
));
?>