Hi Everyone,
<?php echo $form->labelEx($model,'hosting_date');
if($model->hosting_date != null)
{
$dateString = $model->hosting_date;
$date = new DateTime($dateString);
$interval = new DateInterval('P7D'); // Periode of 7 days
$date->add($interval); // $date is not 7 days ahead
$this->beginWidget('zii.widgets.jui.CJuiDatePicker', array(
'id'=>'datepicker',
'model'=>$model,
'attribute'=>'hosting_date',
'name'=>'hosting_date',
'value'=>$date->format('Y-m-d'),
'htmlOptions'=>array('required'=>'required' , 'value'=>date('Y-m-d')),
));
$this->endWidget();
}
Above codes are from my project's update page. I want to see instead of current date, lastly added to the database value but these codes don't work. How can i do this? Thanks for your answers.