Browse Source

修复datepicker datetimepicker空值问题

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

2
vendor/blobt/widgets/DatePicker.php

@ -133,8 +133,10 @@ SCRIPT;
if ($this->hasModel()) {
$timestamp = ArrayHelper::getValue($this->model, $this->attribute);
if (!empty($timestamp)) {
$value = date($this->format, $timestamp);
}
}
if (empty($timestamp) && $this->autoFill) {
$timestamp = time();

2
vendor/blobt/widgets/DatetimePicker.php

@ -133,8 +133,10 @@ SCRIPT;
if ($this->hasModel()) {
$timestamp = ArrayHelper::getValue($this->model, $this->attribute);
if (!empty($timestamp)) {
$value = date($this->format, $timestamp);
}
}
if (empty($timestamp) && $this->autoFill) {
$timestamp = time();

Loading…
Cancel
Save