Small code cleanup [skip ci]

This commit is contained in:
James Cole
2018-07-15 19:17:26 +02:00
parent 73e32ecdcb
commit 1502aa3b20
4 changed files with 32 additions and 15 deletions

View File

@@ -76,7 +76,9 @@ class IndexController extends Controller
public function index(Request $request, string $moment = null)
{
$range = app('preferences')->get('viewRange', '1M')->data;
/** @var Carbon $start */
$start = session('start', new Carbon);
/** @var Carbon $end */
$end = session('end', new Carbon);
$page = 0 === (int)$request->get('page') ? 1 : (int)$request->get('page');
$pageSize = (int)app('preferences')->get('listPageSize', 50)->data;
@@ -86,6 +88,7 @@ class IndexController extends Controller
if ('' !== (string)$moment) {
try {
$start = new Carbon($moment);
/** @var Carbon $end */
$end = app('navigation')->endOfPeriod($start, $range);
} catch (Exception $e) {
// start and end are already defined.