hi guys i need your help,i have a code my code like this http://pastebin.com/m76gtju5 i use ceditablegridview and actually this code work when i want to change value from child_head_office and child_head_office_family,but the problem is when i submit to my action,the register_date and reregister_date become 0000-00-00 whats wrong with my code?please help me ![]()
try to use this
$register_date = date('Y-m-d');
you used the date type for the table db that is why
actually i have already inserted the date like $register_date = date(‘Y-m-d’); in different action and before i run this the date still exist like 2011-12-27,and when i run this action the date become 0000-00-00 again ![]()
check your code maybe beforeSave or afterValidate to ensure that no script is updating that field
thanks,i try to comment this
protected function afterFind()
// {
// parent::afterFind();
// $this->register_date=date("d-m-Y", strtotime($this->register_date));
// $this->reregister_date=date("d-m-Y", strtotime($this->reregister_date));
//
// }
and it works,but how can i change the date format in cgridview and cdetailview automatically?
this way .
replace the "register_date" in the cdetailview with this
.......
array('label'=>'registered date'
'type'=>'raw',
'value'=>date("Y/m/d", $model->registered_date)
)