hello there …
i have problem to make date changes automatic with cjuidatepicker
lets this configuration of that datepicker
<div class="row">
<?php echo $form->labelEx($model,'check_in_date'); ?>
<?php //echo $form->textField($model,'check_in_date');
$this->widget('zii.widgets.jui.CJuiDatePicker',array(
'model'=>$model,
'attribute'=>'check_in_date',
'value'=>'2011/04/22',
//'theme'=>'bee',
'options'=>array(
'dateFormat'=>'yy-mm-dd',
'altField' => '#Reservation_check_in_date',
'altFormat'=>'d M yy',
'showAnim'=>'fold',
'beforeShowDay' => 'js:$.datepicker.noWeekends',
'minDate'=>'0',
'changeMonth'=>true,
'changeYear'=>true,
),
'htmlOptions'=>array(
'style'=>'height:20px;'
),
));
?>
<?php echo $form->error($model,'check_in_date'); ?>
</div>
<div class="row">
<?php echo $form->labelEx($model,'check_out_date'); ?>
<?php //echo $form->textField($model,'check_out_date');
$this->widget('zii.widgets.jui.CJuiDatePicker',array(
'model'=>$model,
'attribute'=>'check_out_date',
//'theme'=>'bee',
'options'=>array(
'dateFormat'=>'yy-mm-dd',
'showAnim'=>'fade',
'altField' => '#Reservation_check_out_date',
'altFormat'=>'d M yy',
//'minDate'=>'+1',
'changeMonth' => true,
'changeYear' => true,
//'beforeShowDays'=>'js:function(){$(this).datepicker.noWeekends}',
//'constrainInput' => false,
//'beforeShowDay'=>'noWeekendsOrHolidays',
'beforeShow' => 'js:function(){
var selectedDate=$("#'.CHtml::activeId($model,'check_in_date').'").datepicker("getDate");
$(this).datepicker("option","minDate",selectedDate);
}'
),
));
?>
<?php echo $form->error($model,'check_out_date'); ?>
</div>
i wanna to write that code similar to site http://www.stay.com/hotel/, but has problem to determine the initial value of checkin/checkout and determine checkout value when checkin date clicked. If i wanna to create similar to stay.com/hotel, what code that must alter?
Thx for suggestion