Used the getFormattedDateObject() function with the expected parameters

This commit is contained in:
Ivan Nieto Vivanco 2022-06-20 19:58:51 -05:00
parent cabef8ff12
commit 3a5c09c424

View file

@ -100,7 +100,7 @@ class AssetsTransformer
if ($field->format == 'DATE'){ if ($field->format == 'DATE'){
if (Gate::allows('superadmin')){ if (Gate::allows('superadmin')){
$value = Helper::getFormattedDateObject($value)['formatted']; $value = Helper::getFormattedDateObject($value, 'date', false);
} else { } else {
$value = strtoupper(trans('admin/custom_fields/general.encrypted')); $value = strtoupper(trans('admin/custom_fields/general.encrypted'));
} }
@ -117,7 +117,7 @@ class AssetsTransformer
$value = $asset->{$field->convertUnicodeDbSlug()}; $value = $asset->{$field->convertUnicodeDbSlug()};
if (($field->format == 'DATE') && (!is_null($value)) && ($value!='')){ if (($field->format == 'DATE') && (!is_null($value)) && ($value!='')){
$value = Helper::getFormattedDateObject($value)['formatted']; $value = Helper::getFormattedDateObject($value, 'date', false);
} }
$fields_array[$field->name] = [ $fields_array[$field->name] = [