Skip to content

Commit ad3bc0f

Browse files
committed
修正DateTime类 关闭时间格式化后的问题
1 parent f4a32fe commit ad3bc0f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/model/type/DateTime.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,8 @@ public function format(string $format = '')
5252
return $this->data->__toString();
5353
}
5454

55-
if (is_null($this->data)) {
56-
return null;
55+
if (is_null($this->data) || is_string($this->data)) {
56+
return $this->data;
5757
}
5858

5959
return $this->data->format($format ?: $this->format);

0 commit comments

Comments
 (0)