mirror of
https://github.com/snipe/snipe-it.git
synced 2025-01-12 06:17:28 -08:00
Merge pull request #11352 from inietov/fixes/assets_transformer_date_customfields_fixes
Fixed #11335 Assets transformer date customfields issues
This commit is contained in:
commit
6bc525bc25
|
@ -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] = [
|
||||
|
|
Loading…
Reference in a new issue