using the extension 'cjuidatetimepicker widget'

Hi, I am new to Yii. I am trying to use and extension for the datetime field in my registration form.How do we use extension. For example, I am trying to use cjuidatetimepicker widget , but it gives error.

I did the following things:

  1. downloaded the extension files and put it in the protected/extensions/ folder.

2.then I replaced the date input field in my form with the following code:

<?php Yii::import(‘application.extensions.CJuiDateTimePicker.CJuiDateTimePicker’);


                    'model'=&gt;&#036;news, //Model object

                    'attribute'=&gt;'eventDate', //attribute name

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

                    'options'=&gt;array() // jquery plugin options



but it gives this error:


CJuiDateTimePicker must specify "model" and "attribute" or "name" property values.


42 /**

43 * @return array the name and the ID of the input.

44 */

45 protected function resolveNameID()

46 {

47 if($this->name!==null)

48 $name=$this->name;

49 else if(isset($this->htmlOptions[‘name’]))

50 $name=$this->htmlOptions[‘name’];

51 else if($this->hasModel())

52 $name=CHtml::activeName($this->model,$this->attribute);

53 else

54 throw new CException(Yii::t(‘zii’,’{class} must specify “model” and “attribute” or “name” property values.’,array(’{class}’=>get_class($this))));


56 if(($id=$this->getId(false))===null)

57 {

58 if(isset($this->htmlOptions[‘id’]))

59 $id=$this->htmlOptions[‘id’];

60 else

61 $id=CHtml::getIdByName($name);

62 }


64 return array($name,$id);

65 }

Ajit, Did you find the answer to this question?