Some code cleanup.

This commit is contained in:
James Cole
2016-11-26 09:01:00 +01:00
parent 1453a78e49
commit 8c9f90f1b4
6 changed files with 15 additions and 17 deletions

View File

@@ -135,13 +135,14 @@ class Range
$start = Session::get('start');
/** @var Carbon $end */
$end = Session::get('end');
$prevStart = clone $start;
$prevEnd = clone $start;
$nextStart = clone $end;
$nextEnd = clone $end;
if ($viewRange === 'custom') {
$days = $start->diffInDays($end);
$prevStart = clone $start;
$days = $start->diffInDays($end);
$prevStart->subDays($days);
$prevEnd = clone $start;
$nextStart = clone $end;
$nextEnd = clone $end;
$nextEnd->addDays($days);
unset($days);
}