mirror of
https://github.com/snipe/snipe-it.git
synced 2025-03-05 20:52:15 -08:00
Default to using the current date if last check in end date is not provided
This commit is contained in:
parent
c332b98456
commit
4e2ef4f056
|
@ -655,10 +655,11 @@ class ReportsController extends Controller
|
||||||
$assets->whereBetween('assets.last_checkout', [$checkout_start, $checkout_end]);
|
$assets->whereBetween('assets.last_checkout', [$checkout_start, $checkout_end]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (($request->filled('checkin_date_start')) && ($request->filled('checkin_date_end'))) {
|
if (($request->filled('checkin_date_start'))) {
|
||||||
$assets->whereBetween('last_checkin', [
|
$assets->whereBetween('last_checkin', [
|
||||||
Carbon::parse($request->input('checkin_date_start'))->startOfDay(),
|
Carbon::parse($request->input('checkin_date_start'))->startOfDay(),
|
||||||
Carbon::parse($request->input('checkin_date_end'))->endOfDay(),
|
// use today's date is `checkin_date_end` is not provided
|
||||||
|
Carbon::parse($request->input('checkin_date_end', now()))->endOfDay(),
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue