Check for blank (not null) values i asset transformer date

Signed-off-by: snipe <snipe@snipe.net>
This commit is contained in:
snipe 2022-06-15 13:42:30 -07:00
parent b3605fa141
commit af66f83a3d

View file

@ -111,13 +111,12 @@ class AssetsTransformer
'value' => e($value),
'field_format' => $field->format,
'element' => $field->element,
];
} else {
$value = $asset->{$field->convertUnicodeDbSlug()};
if ($field->format == 'DATE' && !is_null($value)){
if (($field->format == 'DATE') && (!is_null($value)) && ($value!='')){
$value = Helper::getFormattedDateObject($value)['formatted'];
}