Hello, I am using this datepicker for my _form.php view file, which puts it in both the create and update pages. I defined it as:

$this->widget('zii.widgets.jui.CJuiDatePicker', array(




This works great for the update.php view, which places as a default value the existing date. However, for the create page, it puts 0000-00-00, instead of just an empty string. Any parameter to make it use blank on create.php, like how $form->textField() automatically does? Thanks.

use the model and attribute properties instead of name and value

I tried that but it still defaults to 0000-00-00 in the update view, and I don’t even have anything in the model or controller that sets that default value…

This is strange. What version of Yii are you using?

Could you post the controller, model and view of this example?

Hello guys. It seems that CJuiDatePicker works wrong.

I used CRUD generator in order to generate controller and view. Then I changed



$this->widget('zii.widgets.jui.CJuiDatePicker', array(





                            // additional javascript options for the date picker plugin









But when I choose date and press submit, form’s validator shown me error message: “Date Start cannot be blank.” And I decided to check the “value” attribute of input field which used by zii.widgets.jui.CJuiDatePicker, and it was empty. Even more it was absent. Btw I use Yii 1.1.6.

Can anyone help me to solve this problem?

I posted an example of how to use the CJuiDatePicker Here

thank you so much :)

it helped me :)

i haved tried but not change this value 1970/01/01 07:00:01 AM

this my code

<div class="row">

    &lt;?php echo &#036;form-&gt;labelEx(&#036;model,'time'); ?&gt;

	&lt;?php &#036;this-&gt;widget('zii.widgets.jui.CJuiDatePicker', array(




		//'showAnim'=&gt;'slideDown', // 'show' (the default), 'slideDown', 'fadeIn', 'fold'

		'showOn'=&gt;'button', // 'focus', 'button', 'both'













  &lt;?php echo &#036;form-&gt;error(&#036;model,'time'); ?&gt;


can you help me?

Old problem… still persistent.

My solution was to change mysql schema like

ALTER TABLE  `safefleet_share` CHANGE  `ending`  `ending` TIMESTAMP NULL DEFAULT NULL