diff --git a/vendor/blobt/widgets/DatePicker.php b/vendor/blobt/widgets/DatePicker.php index 2014fb7..b3b7c99 100644 --- a/vendor/blobt/widgets/DatePicker.php +++ b/vendor/blobt/widgets/DatePicker.php @@ -133,7 +133,9 @@ SCRIPT; if ($this->hasModel()) { $timestamp = ArrayHelper::getValue($this->model, $this->attribute); - $value = date($this->format, $timestamp); + if (!empty($timestamp)) { + $value = date($this->format, $timestamp); + } } if (empty($timestamp) && $this->autoFill) { diff --git a/vendor/blobt/widgets/DatetimePicker.php b/vendor/blobt/widgets/DatetimePicker.php index c0abeec..a2e8379 100644 --- a/vendor/blobt/widgets/DatetimePicker.php +++ b/vendor/blobt/widgets/DatetimePicker.php @@ -133,7 +133,9 @@ SCRIPT; if ($this->hasModel()) { $timestamp = ArrayHelper::getValue($this->model, $this->attribute); - $value = date($this->format, $timestamp); + if (!empty($timestamp)) { + $value = date($this->format, $timestamp); + } } if (empty($timestamp) && $this->autoFill) {