I Can Set Cjuidatepicker Date

I set my birthday date four times, in four ways. nevertheless the date input widget remains with empty string value. It should be my birthday date. What’s wrong?


<?php

Yii::app()->clientScript->registerScript('baseUrl', "var baseUrl = '" . Yii::app()->baseUrl . "';", CClientScript::POS_HEAD);

Yii::app()->clientScript->registerScript('childCome', <<<EOF

function myload() {

  $('#main').load(baseUrl+"/editor/childComeAjax", {date:$('#date').val()});

}


$(function() {

  $('#date').datepicker("setDate", '21.07.1980');

  $('#date_container').datepicker("setDate", '21.07.1980');

});

EOF

  , CClientScript::POS_HEAD);

?>


На дату:

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

    'name'=>'date',

    'language'=>'ru',

    'options'=>array('dateFormat'=>'dd.mm.yy', 'changeMonth'=>true, 'changeYear'=>true,

                     "setDate"=>'21.07.1980'),

    'htmlOptions'=>array('value'=>'21.07.1980', 'onchange'=>'')));

?>


<div id="main"></div>

Hi,

Please can you try this code

if empty i set today date

		&#036;model-&gt;pgm_approv_date = isset(&#036;model-&gt;pgm_approv_date) ? date_format(new DateTime(&#036;model-&gt;pgm_approv_date), 'd.m.Y') : date(&quot;d.m.Y&quot;);


		&#036;this-&gt;widget(


			'zii.widgets.jui.CJuiDatePicker',


			array(


				'model'     =&gt; &#036;model,


				'attribute' =&gt; 'pgm_approv_date',


				'language'=&gt; 'de',//default Yii::app()-&gt;language


				//'mode'    =&gt; 'date',//'datetime' or 'date' or 'time' ('datetime' default)


				//'name'=&gt; &#036;model-&gt;pgm_approv_date,


				'value'=&gt; &#036;model-&gt;pgm_approv_date,


				'options'   =&gt; array(


					'dateFormat' =&gt; 'dd.mm.yy',


					//'altField'=&gt; 'pgm_approv_date',


					//'altFormat'=&gt;'dd.mm.yy',


					'disabled'=&gt;&#036;action==='view',


					//'defaultDate' =&gt; isset(&#036;model-&gt;pgm_approv_date) ? date_format(new DateTime(&#036;model-&gt;pgm_approv_date), 'd.m.Y') : date(&quot;d.m.Y&quot;),


					//'timeFormat' =&gt; 'hh:mm tt',//'hh:mm tt' default


					'changeYear'=&gt;true,


					'changeMonth'=&gt;true,


				),


			)


		);