Adds check in condition that format custom dates

This commit is contained in:
Ivan Nieto Vivanco 2022-06-14 01:37:15 -05:00
parent 3e8837dd6e
commit 50c008ead5

View file

@ -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),