mirror of
https://github.com/snipe/snipe-it.git
synced 2024-12-24 21:24:13 -08:00
Sets purchase date as date (versus datetime) in labels
Signed-off-by: snipe <snipe@snipe.net>
This commit is contained in:
parent
00a9d5f33e
commit
88d131666c
|
@ -28,6 +28,11 @@ class FieldOption {
|
|||
return $asset->assignedTo ? $asset->assignedTo->present()->fullName() : null;
|
||||
}
|
||||
|
||||
// Handle Laravel's stupid Carbon datetime casting
|
||||
if ($dataPath[0] === 'purchase_date') {
|
||||
return $asset->purchase_date ? $asset->purchase_date->format('Y-m-d') : null;
|
||||
}
|
||||
|
||||
return $dataPath->reduce(function ($myValue, $path) {
|
||||
try { return $myValue ? $myValue->{$path} : ${$myValue}; }
|
||||
catch (\Exception $e) { return $myValue; }
|
||||
|
|
Loading…
Reference in a new issue