EHtmlDateSelect not writing to database

Hi all,

I am fairly new to Yii and I am trying to use it for some web forms.

I have installed the EHtmlDateSelect widget and I get it to display what I want and how I want it. However, when time comes to save back to the database, nothing happens. If I was editing an old value, the old value is preserved and if I try to insert a new value, nothing happens. Here’s the code in my view:

	<div class="row">

		<?php echo $form->labelEx($model,'DOB'); ?>

	        <?php $this->widget('application.extensions.EHtmlDateSelect',


                              'time'          =>  $model->DOB,

                              'prefix'        =>  '',

                              'field_order'   =>  'DMY',

                              'start_year'    =>  '1850',

                              'end_year'      =>  '+1',



		<?php echo $form->error($model,'DOB'); ?>


Since this extension does not work with the database, then you are required to submit data from this extension to the database. For example:

public function actionEdit()



$dateForDatabase=$this->getDateFrom_EHtmlDateSelect( $_POST['ItemsDate'] );

$model->date= $dateForDatabase;



protected function getDateFrom_EHtmlDateSelect($data)


            	if(empty($data['Month'])) $data['Month']=date('m');

            	if(empty($data['Day'])) $data['Day']=date('d');

            	if(empty($data['Year'])) $data['Year']=date('Y');

            	if(empty($data['Hour'])) $data['Hour']=date('H');

            	if(empty($data['Minute'])) $data['Minute']=date('i');

            	if(empty($data['Second'])) $data['Second']=date('s');

                return mktime(









I’m just a newbie… i have the same problem too but i don’t know where to start… can you please give a more detailed example… like step by step. thanks is advance