Same method of determining the applicable range as the "no category" view. Thanks to @roberthorlings in issue #151

This commit is contained in:
James Cole 2016-02-24 14:49:36 +01:00
parent 07f4995c8f
commit 3976803d8f

View File

@ -190,11 +190,11 @@ class BudgetController extends Controller
*/
public function noBudget(BudgetRepositoryInterface $repository)
{
$range = Preferences::get('viewRange', '1M')->data;
/** @var Carbon $date */
$date = session('start', new Carbon);
$start = Navigation::startOfPeriod($date, $range);
$end = Navigation::endOfPeriod($start, $range);
/** @var Carbon $start */
$start = session('start', Carbon::now()->startOfMonth());
/** @var Carbon $end */
$end = session('end', Carbon::now()->startOfMonth());
$list = $repository->getWithoutBudget($start, $end);
$subTitle = trans(
'firefly.without_budget_between',