Browse Source

修复datepicker datetimepicker空值问题

wechat_public_accounts
blobt 5 years ago
parent
commit
a536bf133f
  1. 4
      vendor/blobt/widgets/DatePicker.php
  2. 4
      vendor/blobt/widgets/DatetimePicker.php

4
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) {

4
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) {

Loading…
Cancel
Save