From 50c008ead5a13a245a965d36bca9ddb151e4d39e Mon Sep 17 00:00:00 2001 From: Ivan Nieto Vivanco Date: Tue, 14 Jun 2022 01:37:15 -0500 Subject: [PATCH] Adds check in condition that format custom dates --- app/Http/Transformers/AssetsTransformer.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/Http/Transformers/AssetsTransformer.php b/app/Http/Transformers/AssetsTransformer.php index 49b74b1e96..4abb4b9201 100644 --- a/app/Http/Transformers/AssetsTransformer.php +++ b/app/Http/Transformers/AssetsTransformer.php @@ -117,9 +117,10 @@ class AssetsTransformer } else { $value = $asset->{$field->convertUnicodeDbSlug()}; - if ($field->format == 'DATE'){ + if ($field->format == 'DATE' && !is_null($value)){ $value = Helper::getFormattedDateObject($value)['formatted']; } + $fields_array[$field->name] = [ 'field' => e($field->convertUnicodeDbSlug()), 'value' => e($value),