This commit is contained in:
James Cole 2018-03-11 13:26:11 +01:00
parent 4304a3c916
commit cfba11e9ca
No known key found for this signature in database
GPG Key ID: C16961E655E74B5E
5 changed files with 12 additions and 4 deletions

View File

@ -304,6 +304,7 @@ class AccountController extends Controller
throw new FireflyException('End is after start!'); // @codeCoverageIgnore
}
$today = new Carbon;
$subTitleIcon = config('firefly.subIconsByIdentifier.' . $account->accountType->type);
$page = intval($request->get('page'));
$pageSize = intval(Preferences::get('listPageSize', 50)->data);
@ -327,7 +328,7 @@ class AccountController extends Controller
return view(
'accounts.show',
compact('account', 'currency', 'periods', 'subTitleIcon', 'transactions', 'subTitle', 'start', 'end', 'chartUri')
compact('account', 'currency','today', 'periods', 'subTitleIcon', 'transactions', 'subTitle', 'start', 'end', 'chartUri')
);
}

View File

@ -312,8 +312,8 @@ function drawAChart(URI, container, chartType, options, colorData) {
fontSize: 12,
fontColor: "#333",
position: "right",
xAdjust: 0,
yAdjust: -120,
xAdjust: -20,
yAdjust: -125,
enabled: true,
content: todayText
}

View File

@ -149,8 +149,15 @@
var expenseBudgetUri = '{{ route('chart.account.expense-budget', [account.id, start.format('Ymd'), end.format('Ymd')]) }}';
{% endif %}
var drawVerticalLine = '';
{# render vertical line with text "today" #}
{% if start.lte(today) and end.gte(today) %}
drawVerticalLine = '{{ today.formatLocalized(monthAndDayFormat) }}';
{% endif %}
</script>
<script type="text/javascript" src="js/lib/Chart.bundle.min.js?v={{ FF_VERSION }}"></script>
<script type="text/javascript" src="js/lib/chartjs-plugin-annotation.min.js?v={{ FF_VERSION }}"></script>
<script type="text/javascript" src="js/ff/charts.defaults.js?v={{ FF_VERSION }}"></script>
<script type="text/javascript" src="js/ff/charts.js?v={{ FF_VERSION }}"></script>

View File

@ -188,7 +188,6 @@
var accountRevenueUri = '{{ route('chart.account.revenue') }}';
var accountExpenseUri = '{{ route('chart.account.expense') }}';
var piggyInfoUri = '{{ route('json.fp.piggy-banks') }}';
var todayText = ' {{ trans('firefly.today')|escape('js') }}';
var drawVerticalLine = '';
{# render vertical line with text "today" #}
{% if start.lte(today) and end.gte(today) %}

View File

@ -39,6 +39,7 @@ var accountingConfig = {{ accounting|json_encode|raw }};
var token = '{{ csrf_token() }}';
var sessionStart = '{{ session('start').format('Y-m-d') }}';
var sessionEnd = '{{ session('end').format('Y-m-d') }}';
var todayText = ' {{ trans('firefly.today')|escape('js') }}';
// some formatting stuff:
var month_and_day_js = "{{ trans('config.month_and_day_js') }}";