Para usar el widget que trae Yii incorporado ir a /protected/views/nombre_del_modelo/_form.php y modificar la fecha por el siguiente código
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 | <?php echo $form ->labelEx( $model , 'fecha_nac_ciudadano' ); //En este caso fecha_nac_ciudadano es nuestro campo fecha ?> <?php $this ->widget( 'zii.widgets.jui.CJuiDatePicker' , array ( 'model' => $model , 'attribute' => 'fecha_nac_ciudadano' , 'value' => $model ->fecha_nac_ciudadano, 'language' => 'es' , 'htmlOptions' => array ( 'readonly' => "readonly" ), 'options' => array ( 'autoSize' =>true, 'defaultDate' => $model ->fecha_nac_ciudadano, 'dateFormat' => 'yy-mm-dd' , 'buttonImage' =>Yii::app()->baseUrl. '/images/calendar.png' , 'buttonImageOnly' =>true, 'buttonText' => 'Fecha' , 'selectOtherMonths' =>true, 'showAnim' => 'slide' , 'showButtonPanel' =>true, 'showOn' => 'button' , 'showOtherMonths' =>true, 'changeMonth' => 'true' , 'changeYear' => 'true' , ), ) );?> |
Adjunto la imagen calendar.png , esa imagen deben de ponerle en la carpeta images dentro de la carpeta principal de su aplicación.
Por más información ir a este link.