Merge pull request #11352 from inietov/fixes/assets_transformer_date_customfields_fixes

Fixed #11335 Assets transformer date customfields issues
This commit is contained in:
snipe 2022-06-21 17:56:17 -07:00 committed by GitHub
commit 6bc525bc25
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

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