Skip to content

Commit fbc8ffe

Browse files
committed
Add 'format' argument to built-in fields 'created' & 'modified'.
1 parent aa82bbb commit fbc8ffe

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/Field/Traits/DatetimeResolverTrait.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,8 @@ public function resolve($value, array $args, ResolveInfo $info)
2828
if (isset($args['format'])) {
2929
$format = $args['format'];
3030
$rawValue = $value->$fieldName;
31-
if (Utils::fields()->get($fieldName) instanceof FieldtypeDatetime) {
31+
$field = Utils::fields()->get($fieldName);
32+
if ($field && $field->type instanceof FieldtypeDatetime) {
3233
$rawValue = $value->getUnformatted($fieldName);
3334
}
3435
if ($rawValue) {

0 commit comments

Comments
 (0)