DATE [merged duplicated post]

Guys,

How to change the DATE format in the forms?, because by default when models were generated it’s been set by textField. I would like to change the textField to dropDown box with the format of YYYY-MM-DD. :)

Some help please with this issue :(

Thanks :)

Guys,

How to change the DATE format in the forms?, because by default when models were generated it’s been set by textField. I would like to change the textField to dropDown box with the format of YYYY-MM-DD. :)

Some help please with this issue :(

Thanks :)

I don’t quite understand what your problem is.

here it goes… for example, i have a field, namely: BIRTHDATE. Then, the default field on it is a textField…

So what I want to do is instead of textField, I want to replace it by dropdown box with the format YYYY-MM-DD.

did I make any sense with this post? :)

Something like this?

http://www.yiiframework.com/extension/activedatelist/

I advice you to read this page, and instead of a dropDopw box you will have a nice calendar.

You can use like that:


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

    'model'=>$model,

    'attribute'=>'date',

));

I think that if you just want to display the date in a text-box , the date is presented in the way the database is giving it to you. I’m not sure if there exists a way to change the behaviour of the database (does not seem to be the case for MySQL, but that one serves the date in the way you want it so I suppose you are not using MySQL).

The other way is to modify the Model component so that it converts the date into the format you like.

i’m a beginner here at yii. can you please state step by step how to apply that? :) thanks in advandce :)

yeah… it’s pretty cool but i dunno how to apply it :unsure:

can you post here the complete steps on how to perfectly run this? and please specify the paths where I will put the codes. thanks :)

I did not use this extension yet, but why not learn by doing?

Check the extension page, it should give you a start:

Okay. I already tried, but I was not successful. I really don’t get it at this moment :-[

It really depends on your project. I strongly advice to learn how to solve these issues by yourself. So how far do you get, what is the problem you are facing? Maybe we can show you the direction you should go.

can you help me make this widget work?.. I don’t know what to do after I extracted the folder in my /extension.