asifa
(Kaziasifa)
1
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' =>array('yy'=>"0000",'mm'=>"00",'dd'=>"00"),
‘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.
asifa
(Kaziasifa)
2
Solved. I removed the default option.
Thanks,