This commit is contained in:
James Cole 2018-01-14 10:57:27 +01:00
parent f59135a9ca
commit 435694e9ea
No known key found for this signature in database
GPG Key ID: C16961E655E74B5E
2 changed files with 4 additions and 3 deletions

View File

@ -316,6 +316,7 @@ class AccountController extends Controller
// prep for "specific date" view.
if (strlen($moment) > 0 && 'all' !== $moment) {
$start = new Carbon($moment);
$start = app('navigation')->startOfPeriod($start, $range);
$end = app('navigation')->endOfPeriod($start, $range);
$fStart = $start->formatLocalized($this->monthAndDayFormat);
$fEnd = $end->formatLocalized($this->monthAndDayFormat);
@ -470,7 +471,7 @@ class AccountController extends Controller
->withOpposingAccount();
$spent = strval($collector->getJournals()->sum('transaction_amount'));
$dateStr = $date['start']->format('Y-m-d');
$dateStr = $date['end']->format('Y-m-d');
$dateName = app('navigation')->periodShow($date['start'], $date['period']);
$entries->push(
[
@ -478,7 +479,7 @@ class AccountController extends Controller
'name' => $dateName,
'spent' => $spent,
'earned' => $earned,
'date' => clone $date['start'],]
'date' => clone $date['end'],]
);
}

View File

@ -126,7 +126,7 @@
<div class="col-lg-2 col-md-4 col-sm-12 col-xs-12">
{% for period in periods %}
{% if (period.spent != 0 or period.earned != 0) %}
<div class="box {% if period.date == start %}box-solid box-primary{% endif %}">
<div class="box {% if period.date == end %}box-solid box-primary{% endif %}">
<div class="box-header with-border">
<h3 class="box-title"><a href="{{ route('accounts.show',[account.id,period.string]) }}">{{ period.name }}</a>
</h3>