Date Format For Textfield

Hi All,

I am trying to use a custom date-pciker and want to set a date field format for the Text Field. Any idea how

data-date="10/11/2012" AND data-date-format="yyyy-mm-dd"

can be set?

I tried using the code below but doesnot seem to work

echo $form->textField($model, 'startdate', array("class" => "form-control date-picker", 'date-format' => 'yyyy-mm-dd'));



You want to custom datepicker format for Display purpose?

set in controller


$visaExpiryDate=date(‘d-m-Y’,strtotime($field[‘Visa_Expiry_date’])); else $visaExpiryDate=’’;

$model->visaExpiryDate = $visaExpiryDate;