I am using Yii::$app->formatter
in one of my attribute like:
Controller code
$model->discharge_date=Yii::$app->formatter->asDatetime
($model->discharge_date, 'php:d-M-Y H:i');
Model Code
[['admission_date','discharge_date'],'date','format' => 'php:d-M-Y H:i'],
Everything is working fine except when discharge date is left blank, on update it is filled with this line:
<span class="not-set">(not set)</span>
I couldn't make out from where this is coming, as in the DB the value is NUll
Thanks.
from Yii2:Date Application Formatter
No comments:
Post a Comment