mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-12-11 17:39:41 +00:00
Fix #1353
This commit is contained in:
@@ -122,9 +122,13 @@ class Range
|
|||||||
// ignore preference. set the range to be the current month:
|
// ignore preference. set the range to be the current month:
|
||||||
if (!Session::has('start') && !Session::has('end')) {
|
if (!Session::has('start') && !Session::has('end')) {
|
||||||
$viewRange = Preferences::get('viewRange', '1M')->data;
|
$viewRange = Preferences::get('viewRange', '1M')->data;
|
||||||
$start = new Carbon;
|
if (null === $viewRange) {
|
||||||
$start = app('navigation')->updateStartDate($viewRange, $start);
|
$viewRange = '1M';
|
||||||
$end = app('navigation')->updateEndDate($viewRange, $start);
|
Preferences::set('viewRange', '1M');
|
||||||
|
}
|
||||||
|
$start = new Carbon;
|
||||||
|
$start = app('navigation')->updateStartDate($viewRange, $start);
|
||||||
|
$end = app('navigation')->updateEndDate($viewRange, $start);
|
||||||
|
|
||||||
Session::put('start', $start);
|
Session::put('start', $start);
|
||||||
Session::put('end', $end);
|
Session::put('end', $end);
|
||||||
@@ -132,10 +136,10 @@ class Range
|
|||||||
if (!Session::has('first')) {
|
if (!Session::has('first')) {
|
||||||
/** @var JournalRepositoryInterface $repository */
|
/** @var JournalRepositoryInterface $repository */
|
||||||
$repository = app(JournalRepositoryInterface::class);
|
$repository = app(JournalRepositoryInterface::class);
|
||||||
$journal = $repository->first();
|
$journal = $repository->firstNull();
|
||||||
$first = Carbon::now()->startOfYear();
|
$first = Carbon::now()->startOfYear();
|
||||||
|
|
||||||
if (null !== $journal->id) {
|
if (null !== $journal) {
|
||||||
$first = $journal->date;
|
$first = $journal->date;
|
||||||
}
|
}
|
||||||
Session::put('first', $first);
|
Session::put('first', $first);
|
||||||
|
|||||||
Reference in New Issue
Block a user