Yii:: Jquery Date Picker

Posted: August 31, 2010 in Php, Yii Framework

Easy with Yii.. Just add code as below to generate JQuery Date Picker

$this->widget(‘zii.widgets.jui.CJuiDatePicker’, array(
‘model’=>$model,
‘attribute’=>’mydate’,
‘options’=>array(
‘dateFormat’=>’dd-mm-yy’,
‘showAnim’=>’fold’,
),
‘htmlOptions’=>array(
‘style’=>’width:290px;’
),
));

Comments
  1. jusernt says:

    Thanks…
    use your code and worked the first time.

    added this point, I took some time, I am giving my first steps in YII🙂



    ‘name’=>’Artista[fech_nac]’,
    ‘model’=>$model,
    ‘value’=>$model->fech_nac,

    Regards.

    • flakesns says:

      update the code..

      $this->widget(‘zii.widgets.jui.CJuiDatePicker’, array(
      ‘model’=>$model,
      ‘attribute’=>’mydate’,
      ‘options’=>array(
      ‘dateFormat’=>’dd-mm-yy’,
      ‘showAnim’=>’fold’,
      ),
      ‘htmlOptions’=>array(
      ‘style’=>’width:290px;’
      ),
      ));

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s