Hey.
I’m having some trouble accessing a CJuiDatePicker after it has been initialized with javascript.
All I want to do is use the .datepicker(‘setDate’, ‘11-Jan-12’) to change the date on the calendar.
Here is the code I’ve got that sets up the DatePicker
$this->widget('zii.widgets.jui.CJuiDatePicker', array(
'name'=>'apptDate',
'themeUrl' => Yii::app()->theme->baseUrl . '/css/jui',
'flat'=>true,
'value'=>date('d-M-y'),
'htmlOptions'=>array(
'id'=>'apptDate',
),
'options'=>array(
'dateFormat'=>'dd-M-yy',
'onSelect' => 'js: function(dateText, inst){
loadData(dateText);
}',
)
));
Here is the code I’m attempting to use to set the date:
$('#apptDate').datepicker('setDate', '17-Jan-12');
Any insight to why the date on the calendar won’t actually change would be a great help.
C