Yii Framework Forum: CJuiDatePicker problem - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

CJuiDatePicker problem Rate Topic: -----

#1 User is offline   dimis283 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 277
  • Joined: 24-January 09

Posted 23 July 2010 - 08:52 AM

I use CJuiDatePicker for a date but since I fill the date there is the error Date cannot be blank. is here
What is wrong?

$this->widget('zii.widgets.jui.CJuiDatePicker', array(
                'name'=>'date_date','model'=>$model,'attribute'=>'date_date',
                // additional javascript options for the date picker plugin
                'options'=>array(
                        'showAnim'=>'fold',
                ),
                'htmlOptions'=>array(
                        'style'=>'height:20px;'
                ),
        ));

Posted Image
0

#2 User is offline   samdark 

  • Having fun
  • Yii
  • Group: Yii Dev Team
  • Posts: 3,782
  • Joined: 17-January 09
  • Location:Russia

Posted 23 July 2010 - 09:35 AM

You should use model and attribute instead of model and name.
Yii 1.1 Application Development Cookbook

Enjoying Yii? Star us at github: 1.1 and 2.0.
0

#3 User is offline   dimis283 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 277
  • Joined: 24-January 09

Posted 23 July 2010 - 11:12 AM

So I have this
$this->widget('zii.widgets.jui.CJuiDatePicker', array(
                'model'=>$model,'attribute'=>'date_date',
                // additional javascript options for the date picker plugin
                'options'=>array(
                        'showAnim'=>'fold',
                ),
                'htmlOptions'=>array(
                        'style'=>'height:20px;'
                ),
        ));

But I have at textfield this 07/03/2010 so the insertion at mysql has error 0000-00-00
Ho can I fix it?
[edit] There is 'dateFormat'=>'YYYY-m-d',
Posted Image
0

#4 User is offline   sharehua 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 456
  • Joined: 30-December 08

Posted 07 September 2010 - 11:38 AM

use 'dateFormat'=>'yy-mm-dd'
YII2 技术群【QQ群--146409855】,欢迎朋友,拒绝过客
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users