From a536bf133f76db3075d6983b1ef26153bfd10fe8 Mon Sep 17 00:00:00 2001 From: blobt <380255922@qq.com> Date: Wed, 4 Sep 2019 10:51:40 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8Ddatepicker=20datetimepicker?= =?UTF-8?q?=E7=A9=BA=E5=80=BC=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- vendor/blobt/widgets/DatePicker.php | 4 +++- vendor/blobt/widgets/DatetimePicker.php | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) 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) {