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) public function noBudget(BudgetRepositoryInterface $repository)
{ {
$range = Preferences::get('viewRange', '1M')->data; /** @var Carbon $start */
/** @var Carbon $date */ $start = session('start', Carbon::now()->startOfMonth());
$date = session('start', new Carbon); /** @var Carbon $end */
$start = Navigation::startOfPeriod($date, $range); $end = session('end', Carbon::now()->startOfMonth());
$end = Navigation::endOfPeriod($start, $range);
$list = $repository->getWithoutBudget($start, $end); $list = $repository->getWithoutBudget($start, $end);
$subTitle = trans( $subTitle = trans(
'firefly.without_budget_between', 'firefly.without_budget_between',