mirror of
https://github.com/snipe/snipe-it.git
synced 2024-12-25 05:34:06 -08:00
Adds check in condition that format custom dates
This commit is contained in:
parent
3e8837dd6e
commit
50c008ead5
|
@ -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),
|
||||
|
|
Loading…
Reference in a new issue