Move date picker stuff to new method.

This commit is contained in:
James Cole 2016-06-11 06:33:51 +02:00
parent 7a5ef6013a
commit b80d8cf774

View File

@ -84,16 +84,22 @@ class Range
}
Session::put('first', $first);
}
$current = Carbon::now()->formatLocalized('%B %Y');
$next = Carbon::now()->endOfMonth()->addDay()->formatLocalized('%B %Y');
$prev = Carbon::now()->startOfMonth()->subDay()->formatLocalized('%B %Y');
View::share('currentMonthName', $current);
View::share('previousMonthName', $prev);
View::share('nextMonthName', $next);
}
$this->datePicker();
return $theNext($request);
}
private function datePicker()
{
$current = Carbon::now()->formatLocalized('%B %Y');
$next = Carbon::now()->endOfMonth()->addDay()->formatLocalized('%B %Y');
$prev = Carbon::now()->startOfMonth()->subDay()->formatLocalized('%B %Y');
View::share('currentMonthName', $current);
View::share('previousMonthName', $prev);
View::share('nextMonthName', $next);
}
}