Commit 548e19ef by Carsten Brandt

datepicker should show empty field when value is empty string

fixes #6471
parent fd332d02
...@@ -5,6 +5,7 @@ Yii Framework 2 jui extension Change Log ...@@ -5,6 +5,7 @@ Yii Framework 2 jui extension Change Log
----------------------- -----------------------
- Enh #6570: Datepicker now uses fallback to find language files, e.g. application language is `de-DE` and the translation files does not exists, it will use `de` instead (cebe) - Enh #6570: Datepicker now uses fallback to find language files, e.g. application language is `de-DE` and the translation files does not exists, it will use `de` instead (cebe)
- Enh #6471: Datepicker will now show an empty field when value is an empty string (cebe)
2.0.1 December 07, 2014 2.0.1 December 07, 2014
......
...@@ -169,7 +169,7 @@ class DatePicker extends InputWidget ...@@ -169,7 +169,7 @@ class DatePicker extends InputWidget
} else { } else {
$value = $this->value; $value = $this->value;
} }
if ($value !== null) { if ($value !== null && $value !== '') {
// format value according to dateFormat // format value according to dateFormat
try { try {
$value = Yii::$app->formatter->asDate($value, $this->dateFormat); $value = Yii::$app->formatter->asDate($value, $this->dateFormat);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment