Yii Framework Forum: Yii – Add A Jquery Datepicker To A Form Field - Yii Framework Forum

Jump to content

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

Yii – Add A Jquery Datepicker To A Form Field Yii – Add a jQuery Datepicker to a form field Rate Topic: -----

#1 User is offline   kiran.irali 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 11
  • Joined: 27-May 13
  • Location:Belgaum

Posted 06 June 2013 - 02:45 AM

<div class="row">
    <?php echo $form->label($model,'date'); ?>
    <?php $this->widget('zii.widgets.jui.CJuiDatePicker', array(
        'model'=>$model,
        'attribute'=>'date',
    )); ?>
    <?php echo $form->error($model,'date'); ?>
</div>

0

#2 User is offline   softark 

  • Keep It Simple
  • Yii
  • Group: Moderators
  • Posts: 2,082
  • Joined: 16-February 11
  • Location:Japan

Posted 06 June 2013 - 04:58 AM

/* Moved from "General Discussion for Yii 1.1.x" to "Tips, Snippets and Tutorials" ...
and also applied the code tag */

0

#3 User is offline   trond 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 110
  • Joined: 26-September 12
  • Location:Oslo, Norway

Posted 28 June 2013 - 02:01 PM

For MySQL it is a good idea to add the date format as well (the default date format is mm/dd/yy which is not understood by MySQL):

        $this->widget('zii.widgets.jui.CJuiDatePicker', array(
            'model' => $model,
            'attribute' => 'date',
            'options' => array(
                'dateFormat' => 'yy-mm-dd',
            ),
        ));

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