date picker

Hi,

I have used the juidatepicker and inserted the following code in the model class

<?php $this->widget(‘zii.widgets.jui.CJuiDatePicker’, array(

‘model’=>$model,

‘attribute’=>‘dob’,

‘options’=>array(

//‘showAnim’=>‘slideDown’, // ‘show’ (the default), ‘slideDown’, ‘fadeIn’, ‘fold’

‘showOn’=>‘focus’, // ‘focus’, ‘button’, ‘both’

‘buttonImage’=>Yii::app()->request->baseUrl.’/images/calendar.png’,

‘buttonImageOnly’=>true,

‘htmlOptions’=>array(‘readonly’=>“readonly”),

‘changeMonth’=>true,

‘changeYear’=>true,

‘mode’=>‘date’,

‘dateFormat’=>‘yy-mm-dd’,

‘htmlOptions’=>array(

‘size’=>43,

'defaultOptions' =&gt;array('yy'=&gt;&quot;0000&quot;,'mm'=&gt;&quot;00&quot;,'dd'=&gt;&quot;00&quot;),

‘value’=>(!empty($model->dob))?(is_numeric($model->dob))?date(‘yy-mm-dd’,$model->dob):$model->dob:date(’

Y-mm-dd’)),

)));?>

But when the form is submitted the date is displayed as 0000-00-00.

Solved. I removed the default option.

Thanks,