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’);

                     &#036;this-&gt;widget('CJuiDateTimePicker',array(


                    '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


                     ));


           ?&gt;

but it gives this error:

CException

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

/home/ubc/Documents/yii/framework/zii/widgets/jui/CJuiInputWidget.php(54)

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))));

55

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 }

63

64 return array($name,$id);

65 }

Ajit, Did you find the answer to this question?