我的 CjuiDatePicker 有问题。在创建模式时它工作正常,但是当你在模式更新时,可以显示时间,我只需要日期。
我该怎么做才能让时间消失?我尝试阅读有关此的问题,但是当我尝试添加 dateFormat 时,什么也没有发生。这是我的代码:
<?php $form=$this->beginWidget('bootstrap.widgets.TbActiveForm',array(
'id'=>'event-form',
'enableAjaxValidation'=>false,
'htmlOptions' => array(
'enctype' => 'multipart/form-data',
),
)); ?>
<p class="help-block">Fields with <span class="required">*</span> are required.</p>
<?php echo $form->errorSummary($model); ?>
<?php echo $form->textFieldRow($model,'event_name',array('class'=>'span5','maxlength'=>255)); ?>
<label for="Event_event_date" class="required">Event Date <span class="required">*</span></label>
<?php
$this->widget('zii.widgets.jui.CJuiDatePicker', array(
'model'=>$model,
'attribute'=>'event_date',
// additional javascript options for the date picker plugin
'options'=>array(
'showAnim'=>'slideDown',
'minDate'=>'new Date()',
'changeMonth'=>true,
'changeYear'=>true,
'dateFormat' => 'yy-mm-dd'
),
));
?>
<?php echo $form->textAreaRow($model,'event_description',array('rows'=>6, 'cols'=>50, 'class'=>'span8')); ?>
<label for="Event_event_image" class="required">Event Image <span class="required">*</span></label>
<?php
if(!$model->isNewRecord){
echo CHtml::image(Yii::app()->request->baseUrl.'/uploads/event/'.$model->event_image,'image',array('width'=>300));
echo '<br />';
}
?>
<?php echo CHtml::activeFileField($model,'event_image'); ?>
<?php echo $form->error($model,'event_image'); ?>
<br /><br />
<?php echo $form->checkBoxRow($model,'published'); ?>
<div class="form-actions">
<?php $this->widget('bootstrap.widgets.TbButton', array(
'buttonType'=>'submit',
'type'=>'primary',
'label'=>$model->isNewRecord ? 'Create' : 'Save',
)); ?>
</div>
<?php $this->endWidget(); ?>