From ea1d7a42e2621837ad60ea31c499f3d46b5c99a4 Mon Sep 17 00:00:00 2001 From: Ivan Nieto Vivanco Date: Wed, 1 Sep 2021 13:08:08 -0500 Subject: [PATCH] Add condition to check if action_date have value and if it have assign it to created_at parameter --- app/Http/Transformers/ActionlogsTransformer.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Http/Transformers/ActionlogsTransformer.php b/app/Http/Transformers/ActionlogsTransformer.php index f2b18fab4e..e13a1686e5 100644 --- a/app/Http/Transformers/ActionlogsTransformer.php +++ b/app/Http/Transformers/ActionlogsTransformer.php @@ -95,7 +95,7 @@ class ActionlogsTransformer 'id' => (int) $actionlog->location->id, 'name' => e($actionlog->location->name) ] : null, - 'created_at' => Helper::getFormattedDateObject($actionlog->created_at, 'datetime'), + 'created_at' => ($actionlog->action_date) ? Helper::getFormattedDateObject($actionlog->action_date, 'datetime'):Helper::getFormattedDateObject($actionlog->created_at, 'datetime'), 'updated_at' => Helper::getFormattedDateObject($actionlog->updated_at, 'datetime'), 'next_audit_date' => ($actionlog->itemType()=='asset') ? Helper::getFormattedDateObject($actionlog->calcNextAuditDate(null, $actionlog->item), 'date'): null, 'days_to_next_audit' => $actionlog->daysUntilNextAudit($settings->audit_interval, $actionlog->item),