CJuiDatePicker doesn't work in Yii 1.1.6?

CJuiDatePicker seems to work with Yii 1.1.5, but not Yii 1.1.6. Does anyone know why this is or if I can do something to fix it?

Here’s the simple code from the view displaying the date picker.




<?php

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

      array(

         'flat'=>true,

         'options'=>array(

            'changeMonth'=>'true',

            'changeYear'=>'true',

         ),

        'htmlOptions'=>array('name'=>'jrdate')));

?>



I guess it’s related to this issue.

Edit: I can reproduce it if I set flat to true (input field goes away completely).

/Tommy

Thanks, but that didn’t work. I never changed the JUI version from 1.8.6 which was installed with Yii 1.1.6. I’m also not attempting to apply any themes from another version – I’m just using the default theme.

Also, the problem isn’t the input field not showing up – that part was intentional. Setting flat to true makes the calendar inline and hides the input field. The problem is that with Yii 1.1.5 I can see the calendar with the above code, but with 1.1.6, I can’t.

I see, didn’t know that.

Have a look at this issue (I had a certain feeling I saw something recently, mentioning a similar problem). Obviously it’s not fixed yet.

/Tommy

I see. I was hoping that wasn’t the case, but thanks for your help. Does anyone know if this is on the bug fix list for the next update?

Hi story,

Actually, I encounter this problem before (similar but not exactly).

I change the "enableAjaxValidation" attribute by setting to true as follows (inside the view pages):

<?php $form=$this->beginWidget(‘CActiveForm’, array(

'id'=&gt;'message-form',


'enableAjaxValidation'=&gt;true,

)); ?>

Kindly try it out and keep us update of the outcome. Thanks.

Hope it help.

Hi may be it is not working because you are saving the date in diff format. plz change your format to database format than only it will be saved correctly i.e. in yyyy-mm-dd format.

so change your datepicker format and check

Thanks for the suggestions, folks, and sorry it took me so long to get back to this thread.

Ajax validation isn’t the problem, and neither is the date format.

I simply reverted to 1.1.5, as "flat" seems to not work in 1.1.6.

I intend to update to 1.1.7 soon, and will let you know if that version can handle it. I’ll leave this thread open until I do.

Alright, so I’ve updated to Yii 1.1.7, and CJuiDatePicker “flat” works. Thanks for the fix, Yii folks!