【发布时间】:2012-02-05 16:04:03
【问题描述】:
我用的是Yii的zii.widgets.jui.CJuiDatePicker,遇到如下问题:
它在插入新记录或更新具有 NULL 日期的记录时效果很好。
但是当我尝试使用日期值更新记录时,我无法更改它。
你知道可能会发生什么吗?
$this->widget('zii.widgets.jui.CJuiDatePicker', array(
'model' => $model,
'attribute' => 'datetime',
'name' => $model->datetime,
'options'=>array(
'showAnim'=>'fold',
'dateFormat'=>'yy-mm-dd',
'altFormat'=>'yy-mm-dd',
'changeMonth'=>'true',
'changeYear'=>'true',
'yearRange'=>'1920:2010',
'showOn'=>'both',
'buttonText'=>'...' ),
'htmlOptions'=>array( 'style'=>'height:20px;' ),
) );
虽然该字段名为 datetime,但它实际上是一个日期 MySQL 字段。
【问题讨论】:
标签: yii uidatepicker jquery-ui-datepicker