Fixed next audit date math

This commit is contained in:
snipe 2019-05-05 20:00:05 -04:00
parent 7497eaf302
commit 00a8a2aff3

View file

@ -9,7 +9,7 @@
@php @php
$next_audit_date = \App\Helpers\Helper::getFormattedDateObject($asset->next_audit_date, 'date', false); $next_audit_date = \App\Helpers\Helper::getFormattedDateObject($asset->next_audit_date, 'date', false);
$last_audit_date = \App\Helpers\Helper::getFormattedDateObject($asset->last_audit_date, 'date', false); $last_audit_date = \App\Helpers\Helper::getFormattedDateObject($asset->last_audit_date, 'date', false);
$diff = Carbon::parse($last_audit_date)->diffInDays(Carbon::now()); $diff = Carbon::parse($next_audit_date)->diffInDays(Carbon::now());
$icon = ($diff <= 7) ? '🚨' : (($diff <= 14) ? '⚠️' : ' '); $icon = ($diff <= 7) ? '🚨' : (($diff <= 14) ? '⚠️' : ' ');
@endphp @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() : '') }} |{{ $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() : '') }}