Skip to content

Commit

Permalink
Fix a bug where GraphQL queries would fail for some date fields.
Browse files Browse the repository at this point in the history
  • Loading branch information
andris-sevcenko committed Aug 19, 2021
1 parent 7be6f5d commit befd5fc
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
### Fixed
- Fixed a bug where Tokenfield inputs weren’t getting sized correctly when the window was resized, if rendered within a field that used a fieldset. ([#9734](https://github.com/craftcms/cms/issues/9734))
- Fixed a bug where row titles with a status were showing as bold in admin tables. ([#9704](https://github.com/craftcms/cms/issues/9704))
- Fix a bug where GraphQL queries would fail if they included date fields that had no values and also had timezones turned off.

## 3.7.9 - 2021-08-17

Expand Down
2 changes: 1 addition & 1 deletion src/fields/Date.php
Original file line number Diff line number Diff line change
Expand Up @@ -401,7 +401,7 @@ public function getContentGqlType()
$value = $source->getFieldValue($fieldName);

// Set the timezone, unless it has been already set by the field itself.
if (!$this->showTimeZone) {
if (!$this->showTimeZone && $value instanceof DateTime) {
$value->setTimeZone(new DateTimeZone(FormatDateTime::defaultTimezone()));
}

Expand Down

0 comments on commit befd5fc

Please sign in to comment.