I am trying to change the default date as first day of previous month in Yii cjuidatepicker. Date is displaying in the textfield correctly,but in the datepicker popup it shows the current date.
Code
$model_form->suspended_date_from =date("d-M-Y", mktime(0, 0, 0, date("m")-1, 1, date("Y")));
$date= date('dd-MM-yy', strtotime($model_form->suspended_date_from));
$this->widget('zii.widgets.jui.CJuiDatePicker', array(
'model' => $model_form,
'attribute' => 'suspended_date_from',
'htmlOptions' => array(
'class' => 'reporttext-field fromdate',
'id' => uniqid(),
),
'options' => array(
'dateFormat' => 'dd-MM-yy',
'defaultDate'=> $date,
// 'beforeShowDay'=>'unavailable',
'showAnim' => 'fade',
//'onSelect' => 'js:function( selectedDate ) {$( ".todate" ).datepicker( "option", "minDate", selectedDate );}'
),
));
How can i show it on the datepicker popup??