so my database field is of type date which is: yy-mm-dd
The code down below is working fine, for yy-mm-dd how ever I want to display the date to the user as mm-dd-yy but insert into the database as yy-mm-dd.
I’ve been trying to use altFormat, and it seems to not work. There really isn’t much documentation about it in CJUI date picker. I also try to set defaultOptions =>array(‘altFormat’ => ‘mm-dd-yy’) but its not working.
<?php
$this->widget('zii.widgets.jui.CJuiDatePicker', array(
'name' => CHtml::activeName($model, 'date'),
'model'=>$model,
'attribute' => 'date',
'value' => $model->attributes['date'],
'options'=>array(
'showAnim'=>'fold',
'dateFormat' => 'yy-mm-dd',
),
'htmlOptions'=>array(
'style'=>'height:20px;',
),
));
?>