Don’t use the formatted date for diff days in audit report

Signed-off-by: snipe <snipe@snipe.net>
This commit is contained in:
snipe 2022-06-02 16:30:26 -07:00
parent 7577fc61e4
commit 4e03ebe284

View file

@ -9,7 +9,7 @@
@php
$next_audit_date = Helper::getFormattedDateObject($asset->next_audit_date, 'date', false);
$last_audit_date = Helper::getFormattedDateObject($asset->last_audit_date, 'date', false);
$diff = Carbon::parse(Carbon::now())->diffInDays($next_audit_date, false);
$diff = Carbon::parse(Carbon::now())->diffInDays($asset->next_audit_date, false);
$icon = ($diff <= 7) ? '🚨' : (($diff <= 14) ? '⚠️' : ' ');
@endphp
|{{ $icon }}| [{{ $asset->present()->name }}]({{ route('hardware.show', $asset->id) }}) | {{ $last_audit_date }}| {{ $next_audit_date }} | {{ $diff }} | {{ ($asset->supplier ? e($asset->supplier->name) : '') }}|{{ ($asset->assignedTo ? $asset->assignedTo->present()->name() : '') }}