TimePicker

Am using time picker in my project…

but am not able to specify ‘attribute’ property…




   $this->widget('ext.timepicker.TimePicker', array(

            'id'=>'datetime',

            'model'=>$model,

            'name'=>'DueDate',

            'options'=>array(

                'duration'=>'',

                'showTime'=>true,

                'time24h'=>false,

                'dateFormat'=>'dd-mm-yy',

                'firstDay' => 1,

                'stepMinutes'=>5,

                'showOn'=>'focus',

                'changeMonth'=>true,

                'changeYear'=>true,

            ),

        )); 




please help me to solve this…

supposing your model name is "YourModel" and your date variable is "date"




'name'=>'YourModel[date]',

'value'=>$model->date,



I know this is an old topic, but incase anyone stumbles across it the same as I did when trying to figure out how to automatically load a value into the textbox, here is how I did it:




$this->widget('application.extensions.timepicker.timepicker', array(

    'model'=>$model,

    'name'=>'date',

    'options'=>array(

        'value'=>CHtml::encode($model->date),

    ),

));



This way, if modifying an existing record, the date (or whatever attribute name) will be automatically loaded if it exists.